qcacld-3.0: Fix race condition between WMI control RX and driver unload

This is a qcacld-2.0 to qcacld-3.0 propagation

Don’t unregister the event in LIM cleanup since it will be take care
by WMI service close. Also in tlshim_mgmt_rx_wmi_handler, add driver
load/unload check to avoid processing any WMI_MGMT_RX_EVENTID event
even the handler is not NULL

Change-Id: I72b53b614218f26e874c964a0d8b0affba6cda79
CRs-Fixed: 904490
This commit is contained in:
Naveen Rawat 2015-11-03 14:15:55 -08:00 • committed by Prakash Dhavali
commit 10ccf878f9
2 changed files with 9 additions and 14 deletions

View file

@ -644,11 +644,10 @@ tSirRetStatus lim_initialize(tpAniSirGlobal pMac)
void lim_cleanup(tpAniSirGlobal pMac)
{
void *p_cds_gctx;
CDF_STATUS retStatus;
/*Before destroying the list making sure all the nodes have been deleted
*Which should be the normal case, but a memory leak has been reported
/*
* Before destroying the list making sure all the nodes have been
* deleted Which should be the normal case, but a memory leak has been
* reported
*/
struct mgmt_frm_reg_info *pLimMgmtRegistration = NULL;
@ -708,15 +707,6 @@ void lim_cleanup(tpAniSirGlobal pMac)
/* Now, finally reset the deferred message queue pointers */
lim_reset_deferred_msg_q(pMac);
p_cds_gctx = cds_get_global_context();
retStatus = wma_de_register_mgmt_frm_client(p_cds_gctx);
if (retStatus != CDF_STATUS_SUCCESS)
PELOGE(lim_log
(pMac, LOGE,
FL
("DeRegistering the PE Handle with wma has failed bailing out..."));
)
#if defined WLAN_FEATURE_VOWIFI
rrm_cleanup(pMac);
#endif

View file

@ -3049,6 +3049,11 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
return -ENOMEM;
}
if (cds_is_load_unload_in_progress()) {
WMA_LOGE("Load/Unload in progress");
return -EINVAL;
}
cdf_mem_zero(rx_pkt, sizeof(*rx_pkt));
/*