Added return code check wolfSSL_CryptHwMutexInit

This commit is contained in:
David Garske 2020-07-31 12:01:09 -07:00
parent c30ffad622
commit 3531b581b5

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;