diff --git a/core/mac/src/pe/lim/lim_process_fils.c b/core/mac/src/pe/lim/lim_process_fils.c index 3a64855841b5..165a64561275 100644 --- a/core/mac/src/pe/lim/lim_process_fils.c +++ b/core/mac/src/pe/lim/lim_process_fils.c @@ -863,7 +863,12 @@ static int lim_create_fils_wrapper_data(struct pe_fils_session *fils_info) uint8_t auth_tag[FILS_AUTH_TAG_MAX_LENGTH] = {0}; uint32_t length = 0; QDF_STATUS status; - int buf_len = + int buf_len; + + if (!fils_info) + return 0; + + buf_len = /* code + identifier */ sizeof(uint8_t) * 2 + /* length */ @@ -877,9 +882,6 @@ static int lim_create_fils_wrapper_data(struct pe_fils_session *fils_info) /* cryptosuite + auth_tag */ sizeof(uint8_t) + lim_get_auth_tag_len(HMAC_SHA256_128); - if (!fils_info) - return 0; - fils_info->fils_erp_reauth_pkt = qdf_mem_malloc(buf_len); if (!fils_info->fils_erp_reauth_pkt) { pe_err("failed to allocate memory");