diff --git a/core/mac/src/pe/lim/lim_process_fils.c b/core/mac/src/pe/lim/lim_process_fils.c index 5596491a0d58..1f2f2706d353 100644 --- a/core/mac/src/pe/lim/lim_process_fils.c +++ b/core/mac/src/pe/lim/lim_process_fils.c @@ -61,7 +61,8 @@ static int lim_get_crypto_digest_len(uint8_t *type) return SHA384_DIGEST_SIZE; else if (!strcmp(type, HMAC_SHA256_CRYPTO_TYPE)) return SHA256_DIGEST_SIZE; - return -EINVAL; + + return 0; } /** @@ -283,6 +284,11 @@ static QDF_STATUS lim_get_key_from_prf(uint8_t *type, uint8_t *secret, uint8_t crypto_digest_len = lim_get_crypto_digest_len(type); uint8_t tmp_hash[SHA384_DIGEST_SIZE] = {0}; + if (!crypto_digest_len) { + pe_err("Incorrect crypto length"); + return QDF_STATUS_E_FAILURE; + } + addr[0] = count; len[0] = sizeof(count);