Revert psa_reserve_free_key_slot changes, lock in start_key_creation instead
This means we can hold the mutex around the call to reserve_free_key_slot in get_and_lock_key_slot, avoiding inefficient rework. (Changes to get_and_lock_key_slot are not in scope in this PR) Signed-off-by: Ryan Everett <ryan.everett@arm.com>
This commit is contained in:
parent
b71014406c
commit
3d8118d9dc
3 changed files with 18 additions and 17 deletions
|
@ -1679,7 +1679,15 @@ static psa_status_t psa_start_key_creation(
|
|||
return status;
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_THREADING_C)
|
||||
PSA_THREADING_CHK_RET(mbedtls_mutex_lock(
|
||||
&mbedtls_threading_key_slot_mutex));
|
||||
#endif
|
||||
status = psa_reserve_free_key_slot(&volatile_key_id, p_slot);
|
||||
#if defined(MBEDTLS_THREADING_C)
|
||||
PSA_THREADING_CHK_RET(mbedtls_mutex_unlock(
|
||||
&mbedtls_threading_key_slot_mutex));
|
||||
#endif
|
||||
if (status != PSA_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue