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
This commit is contained in:
Pragaspathi Thilagaraj 2018-06-19 17:41:37 +05:30 • committed by nshrivas
commit 655db19762

View file

@ -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;
}