From cb05ce30e990f7e60c47b18af95cf21c8213a614 Mon Sep 17 00:00:00 2001 From: Ryan Everett Date: Tue, 23 Jan 2024 19:25:10 +0000 Subject: [PATCH] Minor fixes to locking macros Signed-off-by: Ryan Everett --- library/psa_crypto_core.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/psa_crypto_core.h b/library/psa_crypto_core.h index 8b5ac26c6e..0e9f83faee 100644 --- a/library/psa_crypto_core.h +++ b/library/psa_crypto_core.h @@ -144,7 +144,7 @@ typedef enum { return status; \ } \ } \ - if (op == PSA_MUTEX_UNLOCK) { \ + else if (op == PSA_MUTEX_UNLOCK) { \ if (mbedtls_mutex_unlock( \ &mbedtls_threading_key_slot_mutex) != 0) { \ if (status == PSA_SUCCESS) { \ @@ -163,7 +163,7 @@ typedef enum { * Call with parameter PSA_MUTEX_LOCK to perform a lock operation. * Call with parameter PSA_MUTEX_UNLOCK to perform an unlock operation. * This will goto the exit label if the operation fails, - * setting status to PSA_SERVICE_FAILURE if status was PSA_SUCCESS. + * setting status to PSA_ERROR_SERVICE_FAILURE if status was PSA_SUCCESS. * If threading is not enabled, do nothing. * * Assumptions: @@ -184,7 +184,7 @@ typedef enum { goto exit; \ } \ } \ - if (op == PSA_MUTEX_UNLOCK) { \ + else if (op == PSA_MUTEX_UNLOCK) { \ if (mbedtls_mutex_unlock( \ &mbedtls_threading_key_slot_mutex) != 0) { \ if (status == PSA_SUCCESS) { \