Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some more unnecessary lock code. #34303

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions src/app/clusters/door-lock-server/door-lock-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2923,28 +2923,6 @@ Status DoorLockServer::clearCredential(chip::EndpointId endpointId, chip::Fabric
return Status::Failure;
}

uint8_t maxCredentialsPerUser;
if (!GetNumberOfCredentialsSupportedPerUser(endpointId, maxCredentialsPerUser))
{
ChipLogError(Zcl,
"[clearCredential] Unable to get the number of available credentials per user: internal error "
"[endpointId=%d,credentialType=%d,credentialIndex=%d]",
endpointId, to_underlying(credentialType), credentialIndex);
return Status::Failure;
}

// Should never happen, only possible if the implementation of application is incorrect
if (relatedUser.credentials.size() > maxCredentialsPerUser)
{
ChipLogError(Zcl,
"[clearCredential] Unable to clear credential for related user - user has too many credentials associated"
"[endpointId=%d,credentialType=%u,credentialIndex=%d,modifier=%d,userIndex=%d,credentialsCount=%u]",
endpointId, to_underlying(credentialType), credentialIndex, modifier, relatedUserIndex,
static_cast<unsigned int>(relatedUser.credentials.size()));

return Status::Failure;
}

chip::Platform::ScopedMemoryBuffer<CredentialStruct> newCredentials;
if (!newCredentials.Alloc(relatedUser.credentials.size()))
{
Expand Down
Loading