Added return code check `wolfSSL_CryptHwMutexInit`

pull/3169/head
David Garske 2020-07-31 12:01:09 -07:00
parent c30ffad622
commit 3531b581b5
1 changed files with 3 additions and 2 deletions

View File

@ -837,8 +837,9 @@ int wolfSSL_CryptHwMutexInit(void)
int wolfSSL_CryptHwMutexLock(void)
{
int ret = BAD_MUTEX_E;
wolfSSL_CryptHwMutexInit(); /* Make sure HW Mutex has been initialized */
if (wcCryptHwMutexInit) {
/* Make sure HW Mutex has been initialized */
ret = wolfSSL_CryptHwMutexInit();
if (ret == 0) {
ret = wc_LockMutex(&wcCryptHwMutex);
}
return ret;