summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMukul Sharma <mukul@qti.qualcomm.com>2015-08-31 17:44:20 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2015-09-02 12:41:52 +0530
commitb56c7cdd4bd6bc9fc1099e83a72b25764cba57e9 (patch)
tree5b78a8e466334aacc9a75e7608a90bd0263585f4
parent95122b985751067b1685faec2c6c1d506e4b089f (diff)
qcacld-2.0: Ensure tlshim ctx is valid
While processing rx event work, host accessing tl shim ctx without validation. As rx work may be invoked asynchronously, it is possible in unload path host have freed it and later in rx work host try to access it and lead to crash. As a part of this fix, host is validating tlshim ctx before accessing it. Change-Id: Icaf098f81397de91f48250eb688e625c1480c031 CRs-Fixed: 898678
-rw-r--r--CORE/CLD_TXRX/TLSHIM/tl_shim.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/CORE/CLD_TXRX/TLSHIM/tl_shim.c b/CORE/CLD_TXRX/TLSHIM/tl_shim.c
index 80a2b5a4eef8..4bbe1b3db2a4 100644
--- a/CORE/CLD_TXRX/TLSHIM/tl_shim.c
+++ b/CORE/CLD_TXRX/TLSHIM/tl_shim.c
@@ -773,6 +773,11 @@ static int tlshim_mgmt_rx_wmi_handler(void *context, u_int8_t *data,
return (-1);
}
+ if (!tl_shim) {
+ TLSHIM_LOGE("%s: tl shim ctx is NULL\n", __func__);
+ return (-1);
+ }
+
adf_os_spin_lock_bh(&tl_shim->mgmt_lock);
ret = tlshim_mgmt_rx_process(context, data, data_len, FALSE, 0);
adf_os_spin_unlock_bh(&tl_shim->mgmt_lock);