Skip to content

Commit

Permalink
Fix incorrect initialization of mNextKeyID from storage (#6524)
Browse files Browse the repository at this point in the history
Merge bypassing the 'Unit/Integration test report wait' - that report seems to be broken.
  • Loading branch information
sagar-apple authored and pull[bot] committed Sep 8, 2021
1 parent 74a1352 commit b6d3700
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,9 @@ CHIP_ERROR DeviceCommissioner::Init(NodeId localDeviceId, CommissionerInitParams
{
ReturnErrorOnFailure(DeviceController::Init(localDeviceId, params));

uint16_t size = sizeof(mNextKeyId);
if (!mStorageDelegate->SyncGetKeyValue(kNextAvailableKeyID, &mNextKeyId, size) || (size != sizeof(mNextKeyId)))
uint16_t size = sizeof(mNextKeyId);
CHIP_ERROR error = mStorageDelegate->SyncGetKeyValue(kNextAvailableKeyID, &mNextKeyId, size);
if (error || (size != sizeof(mNextKeyId)))
{
mNextKeyId = 0;
}
Expand Down

0 comments on commit b6d3700

Please sign in to comment.