summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Kumar Dhanotiya <adhanoti@codeaurora.org>2018-05-11 14:18:19 +0530
committernshrivas <nshrivas@codeaurora.org>2018-05-15 06:01:06 -0700
commitabb7ed487e0a6be205cd3105338e42b67d883e0e (patch)
tree40cb54c19c81d8fcb7faa155e25e693d3b0a21f0
parentab6956c8f6022eeae56a33c73189f59860acb211 (diff)
qcacld-3.0: Avoid NULL pointer access in cfg80211 tdls oper
Add a check for tdls_ctx to avoid NULL pointer dereference. Change-Id: I5df1d1c51b48ddb9f1afdd0893cf72149c3ce94a CRs-Fixed: 2240466
-rw-r--r--core/hdd/src/wlan_hdd_tdls.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index 42ad8c6bc845..351936082194 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -4806,11 +4806,16 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
pAdapter->sessionId, oper));
status = wlan_hdd_validate_context(pHddCtx);
- tdls_ctx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
-
if (0 != status)
return status;
+ tdls_ctx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
+ if (!tdls_ctx) {
+ QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
+ "%s: Invalid tdls context", __func__);
+ return -EINVAL;
+ }
+
/* QCA 2.0 Discrete ANDs feature capability in HDD config with that
* received from target, so HDD config gives combined intersected result
*/