qcacld-3.0: Check the validity of CDS context before disable WDI path

While WLAN module closed, there is a race condition and CDS scheduler
could not be closed before CDS context closure.
This could cause a crash by acessing NULL cds context while the last
WLAN_CLIENT_DISCONNECT event processing.
Fix to check the CDS context before processing the last disconenct
event.

Change-Id: I9aba4659ec6ea682697f342d9c92e09d8f2f90e8
CRs-Fixed: 1096347
This commit is contained in:
Yun Park
2016-11-30 10:09:21 -08:00
committed by qcabuildsw
parent a61310a3bb
commit 7c4f31b19f

View File

@@ -1299,6 +1299,12 @@ static void hdd_ipa_uc_handle_last_discon(struct hdd_ipa_priv *hdd_ipa)
p_cds_contextType cds_ctx = hdd_ipa->hdd_ctx->pcds_context;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
if (!cds_ctx || !cds_ctx->pdev_txrx_ctx) {
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "txrx context is NULL");
QDF_ASSERT(0);
return;
}
hdd_ipa->resource_unloading = true;
HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO, "%s: Disable FW RX PIPE", __func__);
cdp_ipa_set_active(soc, cds_ctx->pdev_txrx_ctx, false, false);
@@ -4152,9 +4158,11 @@ static int __hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
if (hdd_ipa->resource_loading) {
unsigned int pending_event_count;
struct ipa_uc_pending_event *pending_event = NULL;
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, "IPA resource %s inprogress",
hdd_ipa->resource_loading ? "load":"unload");
hdd_err("IPA resource %s inprogress",
hdd_ipa->resource_loading ? "load":"unload");
@@ -4172,7 +4180,8 @@ static int __hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
}
if (!pending_event) {
hdd_err("Pending event memory alloc fail");
HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR,
"Pending event memory alloc fail");
qdf_mutex_release(&hdd_ipa->event_lock);
return -ENOMEM;
}