Make sure the lock is released when returning

This commit is contained in:
Jakub Jelen 2017-04-12 17:42:54 +02:00 committed by Frank Morgner
parent 76d59158fe
commit 7214516547
1 changed files with 8 additions and 4 deletions

View File

@ -487,12 +487,16 @@ CK_RV C_GetTokenInfo(CK_SLOT_ID slotID, CK_TOKEN_INFO_PTR pInfo)
goto out;
}
if (slot->p11card == NULL)
return CKR_TOKEN_NOT_PRESENT;
if (slot->p11card == NULL) {
rv = CKR_TOKEN_NOT_PRESENT;
goto out;
}
fw_data = (struct pkcs15_fw_data *) slot->p11card->fws_data[slot->fw_data_idx];
if (!fw_data)
return sc_to_cryptoki_error(SC_ERROR_INTERNAL, "C_GetTokenInfo");
if (!fw_data) {
rv = sc_to_cryptoki_error(SC_ERROR_INTERNAL, "C_GetTokenInfo");
goto out;
}
p15card = fw_data->p15_card;
/* User PIN flags are cleared before re-calculation */