diff options
| author | Krishna Kumaar Natarajan <kknatara@qca.qualcomm.com> | 2015-06-24 14:48:52 -0700 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-07-10 20:33:32 +0530 |
| commit | 6def732ff6c712e69059f4b74ce697e091cbc232 (patch) | |
| tree | e096a1ddce6ca3fba946f7b6e23cde4a80382595 | |
| parent | d6b53d1623e9e1d585180e7a7d5c2a6b7d689336 (diff) | |
qcacld-2.0: wlan: Fix memory leak in limSendSmeDisassocNtf.
prima to qcacld-2.0 propagation
In function limSendSmeDisassocNtf, there are some
instance where we return from this func, without
calling peDeleteSession. In peDeleteSession, memory
allocated to various structure such as StartBssReq
are freed. As a result we have memory leak here. As
part of fix make sure the memory allocated is properly
freed.
Change-Id: If4f7148aa3b7d6478ccc173aa9125dd8599c5410
CRs-Fixed: 821512
| -rw-r--r-- | CORE/MAC/src/pe/lim/limSendSmeRspMessages.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c index 3be54d7b168e..43e30111e079 100644 --- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c +++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c @@ -1490,12 +1490,15 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, tSirSmeDisassocRsp *pSirSmeDisassocRsp; tSirSmeDisassocInd *pSirSmeDisassocInd; tANI_U32 *pMsg; + bool failure = false; switch (disassocTrigger) { case eLIM_PEER_ENTITY_DISASSOC: - if (reasonCode != eSIR_SME_STA_NOT_ASSOCIATED) - return; + if (reasonCode != eSIR_SME_STA_NOT_ASSOCIATED) { + failure = true; + goto error; + } case eLIM_HOST_DISASSOC: /** @@ -1510,7 +1513,8 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, limLog(pMac, LOGP, FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_RSP")); - return; + failure = true; + goto error; } limLog(pMac, LOG1, FL("send eWNI_SME_DEAUTH_RSP with " "retCode: %d for "MAC_ADDRESS_STR),reasonCode, @@ -1560,7 +1564,8 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, limLog(pMac, LOGP, FL("call to AllocateMemory failed for eWNI_SME_DISASSOC_IND")); - return; + failure = true; + goto error; } limLog(pMac, LOG1, FL("send eWNI_SME_DISASSOC_IND with " "retCode: %d for "MAC_ADDRESS_STR),reasonCode, @@ -1592,6 +1597,7 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, break; } +error: /* Delete the PE session Created */ if ((psessionEntry != NULL) && (LIM_IS_STA_ROLE(psessionEntry) || @@ -1599,8 +1605,9 @@ limSendSmeDisassocNtf(tpAniSirGlobal pMac, peDeleteSession(pMac,psessionEntry); } - limSendSmeDisassocDeauthNtf( pMac, eHAL_STATUS_SUCCESS, - (tANI_U32*) pMsg ); + if (false == failure) + limSendSmeDisassocDeauthNtf(pMac, eHAL_STATUS_SUCCESS, + (tANI_U32*) pMsg); } /*** end limSendSmeDisassocNtf() ***/ |
