summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryeshwanth sriram guntuka <ysriramg@codeaurora.org>2017-06-12 17:08:12 +0530
committersnandini <snandini@codeaurora.org>2017-07-11 00:50:31 -0700
commitf1bcdb22cf24d3c8481566fd4b0f2bbb7b660daf (patch)
treeef7975779dd3ffbd686eb05c4cf6061f98d32e38
parent35ff0ccaa9c7a3f4c7d525fc2e25b49f0fa661a8 (diff)
qcacld-2.0: Fix memory allocation error
Allocation of memory for assoc resp fails when frame length is zero and error message is displayed. Fix is to allocate memory only when frame length is greater than zero. Change-Id: I6c3a457b7eb9d49fa67bee7570594dd81c2eb3d7 CRs-Fixed: 2060384
-rw-r--r--CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
index 9a743b89052b..76481fd5dc26 100644
--- a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
@@ -544,16 +544,18 @@ limProcessAssocRspFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tANI_U8 sub
psessionEntry->assocRspLen = 0;
}
- psessionEntry->assocRsp = vos_mem_malloc(frameLen);
- if (NULL == psessionEntry->assocRsp)
- {
- PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc response, len = %d"), frameLen);)
- }
- else
- {
- //Store the Assoc response. This is sent to csr/hdd in join cnf response.
- vos_mem_copy(psessionEntry->assocRsp, pBody, frameLen);
- psessionEntry->assocRspLen = frameLen;
+ if (frameLen) {
+ psessionEntry->assocRsp = vos_mem_malloc(frameLen);
+ if (NULL == psessionEntry->assocRsp)
+ {
+ PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc response, len = %d"), frameLen);)
+ }
+ else
+ {
+ //Store the Assoc response. This is sent to csr/hdd in join cnf response.
+ vos_mem_copy(psessionEntry->assocRsp, pBody, frameLen);
+ psessionEntry->assocRspLen = frameLen;
+ }
}
#ifdef WLAN_FEATURE_VOWIFI_11R