From 655db1976277ab77080871c8beca0112d5d1a1f6 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Tue, 19 Jun 2018 17:41:37 +0530 Subject: [PATCH] qcacld-3.0: Fix mem leak in lim_handle_csa_offload_msg The function lim_handle_csa_offload_msg, posts the eWNI_SME_CSA_OFFLOAD_EVENT msg to sme. The csa_offload_ind allocated is not freed during failure cases and this will result in memory leak during the failure cases. Free the memory allocated for csa_offload_ind for the failure cases. CRs-Fixed: 2263376 Change-Id: I6e25500c0e3a0cc2fa71601d935ec9bbe866dc2b --- core/mac/src/pe/lim/lim_send_sme_rsp_messages.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index b991d2dcbe3f..669f8aa6c37a 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1966,6 +1966,7 @@ void lim_handle_csa_offload_msg(tpAniSirGlobal mac_ctx, if (!session_entry) { pe_err("Session does not exists for %pM", csa_params->bssId); + qdf_mem_free(csa_offload_ind); goto err; } @@ -1974,11 +1975,13 @@ void lim_handle_csa_offload_msg(tpAniSirGlobal mac_ctx, if (!sta_ds) { pe_err("sta_ds does not exist"); + qdf_mem_free(csa_offload_ind); goto err; } if (!LIM_IS_STA_ROLE(session_entry)) { pe_debug("Invalid role to handle CSA"); + qdf_mem_free(csa_offload_ind); goto err; } @@ -2152,6 +2155,7 @@ void lim_handle_csa_offload_msg(tpAniSirGlobal mac_ctx, (session_entry->ch_width == session_entry->gLimChannelSwitch.ch_width)) { pe_debug("Ignore CSA, no change in ch and bw"); + qdf_mem_free(csa_offload_ind); goto err; }