Skip to content

Commit

Permalink
EFR lock example: Fix crash from lock (#18623)
Browse files Browse the repository at this point in the history
Efr lock example was crashing from a missing lock at init.
Added the required lock around the offending code.
  • Loading branch information
rgoliver authored and pull[bot] committed Jul 13, 2023
1 parent 8c04162 commit 1626988
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/lock-app/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ CHIP_ERROR AppTask::Init()
chip::EndpointId endpointId{ 1 };
chip::DeviceLayer::PlatformMgr().LockChipStack();
chip::app::Clusters::DoorLock::Attributes::LockState::Get(endpointId, state);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();

uint8_t maxCredentialsPerUser = 0;
if (!DoorLockServer::Instance().GetNumberOfCredentialsSupportedPerUser(endpointId, maxCredentialsPerUser))
Expand All @@ -246,6 +245,7 @@ CHIP_ERROR AppTask::Init()
endpointId);
maxCredentialsPerUser = 5;
}
chip::DeviceLayer::PlatformMgr().UnlockChipStack();

err = LockMgr().Init(state, maxCredentialsPerUser);
if (err != CHIP_NO_ERROR)
Expand Down

0 comments on commit 1626988

Please sign in to comment.