From eae1ad0f0efa7a80441cabdea9683af4c08047e1 Mon Sep 17 00:00:00 2001 From: Krishna Kumaar Natarajan Date: Wed, 21 Jan 2015 18:04:05 -0800 Subject: qcacld: memset the command buffer in GetCommandBuffer routine Currently command buffer returned by GetCommandBuffer routine is not memset to zero. If all the fields are not populated, there could be some stale entries which could result in crash. This change set fixes the issue by setting command buffer to zero before returning it to the caller. Change-Id: Icdf22c79a71f41e0cba449b582ded0701e766cae CRs-Fixed: 785556 --- CORE/SME/src/sme_common/sme_Api.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index db59cedac329..4c977dcfe151 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -454,7 +454,12 @@ tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) csrLLUnlock(&pMac->roam.roamCmdPendingList); } - return( pRetCmd ); + /* memset to zero */ + vos_mem_set((tANI_U8 *)&pRetCmd->command, sizeof(pRetCmd->command), 0); + vos_mem_set((tANI_U8 *)&pRetCmd->sessionId, sizeof(pRetCmd->sessionId), 0); + vos_mem_set((tANI_U8 *)&pRetCmd->u, sizeof(pRetCmd->u), 0); + + return(pRetCmd); } -- cgit v1.2.3