diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp index 3d73bd69b37589..81e3f5f1b92157 100644 --- a/src/app/clusters/access-control-server/access-control-server.cpp +++ b/src/app/clusters/access-control-server/access-control-server.cpp @@ -177,7 +177,7 @@ CHIP_ERROR AccessControlAttribute::ReadAcl(AttributeValueEncoder & aEncoder) { auto fabric = info.GetFabricIndex(); ReturnErrorOnFailure(GetAccessControl().Entries(fabric, iterator)); - CHIP_ERROR err; + CHIP_ERROR err = CHIP_NO_ERROR; while ((err = iterator.Next(entry)) == CHIP_NO_ERROR) { ReturnErrorOnFailure(encoder.Encode(encodableEntry));