mirror of https://github.com/ARMmbed/mbed-os.git
crypto: Fix "refence count" typo
Rename the reference count variable to something shorter and avoid using the mispelling "refence".pull/11315/head
parent
97447677ba
commit
dafbf27340
|
|
@ -34,7 +34,7 @@ typedef struct psa_spm_hash_clone_s {
|
||||||
} psa_spm_hash_clone_t;
|
} psa_spm_hash_clone_t;
|
||||||
|
|
||||||
// ---------------------------------- Globals ----------------------------------
|
// ---------------------------------- Globals ----------------------------------
|
||||||
static int psa_spm_init_refence_counter = 0;
|
static int psa_spm_init_count = 0;
|
||||||
|
|
||||||
/* maximal memory allocation for reading large hash or mac input buffers.
|
/* maximal memory allocation for reading large hash or mac input buffers.
|
||||||
the data will be read in chunks of size */
|
the data will be read in chunks of size */
|
||||||
|
|
@ -138,8 +138,8 @@ static void psa_crypto_init_operation(void)
|
||||||
case PSA_IPC_CALL: {
|
case PSA_IPC_CALL: {
|
||||||
status = psa_crypto_init();
|
status = psa_crypto_init();
|
||||||
if (status == PSA_SUCCESS) {
|
if (status == PSA_SUCCESS) {
|
||||||
++psa_spm_init_refence_counter;
|
++psa_spm_init_count;
|
||||||
if (psa_spm_init_refence_counter == 1) {
|
if (psa_spm_init_count == 1) {
|
||||||
memset(psa_spm_hash_clones, 0, sizeof(psa_spm_hash_clones));
|
memset(psa_spm_hash_clones, 0, sizeof(psa_spm_hash_clones));
|
||||||
psa_crypto_access_control_init();
|
psa_crypto_access_control_init();
|
||||||
}
|
}
|
||||||
|
|
@ -175,11 +175,11 @@ static void psa_crypto_free_operation(void)
|
||||||
/** perform crypto_free iff the number of init-s
|
/** perform crypto_free iff the number of init-s
|
||||||
* is equal to the number of free-s
|
* is equal to the number of free-s
|
||||||
*/
|
*/
|
||||||
if (psa_spm_init_refence_counter > 0) {
|
if (psa_spm_init_count > 0) {
|
||||||
--psa_spm_init_refence_counter;
|
--psa_spm_init_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (psa_spm_init_refence_counter == 0) {
|
if (psa_spm_init_count == 0) {
|
||||||
memset(psa_spm_hash_clones, 0, sizeof(psa_spm_hash_clones));
|
memset(psa_spm_hash_clones, 0, sizeof(psa_spm_hash_clones));
|
||||||
psa_crypto_access_control_destroy();
|
psa_crypto_access_control_destroy();
|
||||||
mbedtls_psa_crypto_free();
|
mbedtls_psa_crypto_free();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue