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
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 b991d2d..669f8aa 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 @@
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 @@
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 @@
(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;
}