Skip to content

Commit

Permalink
[nrf toup] Use cleanup flag for fabric delete in FailSafeCleanup
Browse files Browse the repository at this point in the history
Cleanup all (even when incomplete) fabric data.

Signed-off-by: Adrian Gielniewski <[email protected]>
  • Loading branch information
adigie committed Feb 25, 2025
1 parent 98fadfe commit 595ef2b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ const FabricInfo * RetrieveCurrentFabric(CommandHandler * aCommandHandler)
return Server::GetInstance().GetFabricTable().FindFabricWithIndex(index);
}

CHIP_ERROR DeleteFabricFromTable(FabricIndex fabricIndex)
CHIP_ERROR DeleteFabricFromTable(FabricIndex fabricIndex, bool cleanup = false)
{
ReturnErrorOnFailure(Server::GetInstance().GetFabricTable().Delete(fabricIndex));
ReturnErrorOnFailure(Server::GetInstance().GetFabricTable().Delete(fabricIndex, cleanup));
return CHIP_NO_ERROR;
}

Expand Down Expand Up @@ -303,7 +303,7 @@ void FailSafeCleanup(const chip::DeviceLayer::ChipDeviceEvent * event)
if (event->FailSafeTimerExpired.addNocCommandHasBeenInvoked)
{
CHIP_ERROR err;
err = DeleteFabricFromTable(fabricIndex);
err = DeleteFabricFromTable(fabricIndex, true);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "OpCreds: failed to delete fabric at index %u: %" CHIP_ERROR_FORMAT, fabricIndex, err.Format());
Expand Down

0 comments on commit 595ef2b

Please sign in to comment.