diff options
| author | Naveen Rawat <naveenrawat@codeaurora.org> | 2018-04-30 14:43:47 -0700 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2018-05-03 11:24:24 -0700 |
| commit | a08df6c3cab822a8e680060fc09bb665a0ff8cd9 (patch) | |
| tree | f7cb740239a92e0e75aed3655fa050f0cb24c2bc | |
| parent | 8498cde90f08005898d9c15ab9c3a5218e555e9b (diff) | |
qcacld-3.0: Fix NPD in function lim_create_fils_wrapper_data
Fix NPD in function lim_create_fils_wrapper_data, by moving the check
against NULL pointer before the access.
Change-Id: I00c6c4df0ff94ffdfe77a8a563b1747c29906b2f
CRs-Fixed: 2232734
| -rw-r--r-- | core/mac/src/pe/lim/lim_process_fils.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/mac/src/pe/lim/lim_process_fils.c b/core/mac/src/pe/lim/lim_process_fils.c index 57c26243abff..502a887d4e9a 100644 --- a/core/mac/src/pe/lim/lim_process_fils.c +++ b/core/mac/src/pe/lim/lim_process_fils.c @@ -862,7 +862,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 */ @@ -876,9 +881,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"); |
