From 589fd7061522dfad904bfae5f9c7a62c41e50158 Mon Sep 17 00:00:00 2001 From: Hanumantha Reddy Pothula Date: Tue, 17 Nov 2015 15:25:16 +0530 Subject: [PATCH] qcacld-3.0: Resolve invalid memory access while processing GET STATES IOCTL qcacld-2.0 to qcacld-3.0 propagation While processing GET STATES IOCTL, in a while loop, HOST prints PE, LIM and MLM states of each session. Normally while loading, HOST allocates memory for five sessions, but while processing this IOCTL, it iterating in a loop assuming there are 255 sessions allocated, leading to crash because of invalid memory access. Hence while printing PE, LIM and MLM states iterate only for allocated number of sessions. Change-Id: I29c9a627615a1983d23831578f45aefe116dac25 CRs-Fixed: 879950 --- core/sme/src/common/sme_api.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index b0337adde444..6c8ef59444b1 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -9333,6 +9333,10 @@ uint32_t sme_get_lim_mlm_state(tHalHandle hHal) bool sme_is_lim_session_valid(tHalHandle hHal, uint8_t sessionId) { tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + + if (sessionId > pMac->lim.maxBssId) + return false; + return pMac->lim.gpSession[sessionId].valid; }