prima: Fix Null pointer dereference
Fix Null pointer dereference while handling TDLS DISABLE_LINK
request from supplicant.
Change-Id: I5d50f081ff115f1bf7de20742257ee43a3655103
CRs-Fixed: 925275
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index eb8bc31..1c88d3b 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -17819,8 +17819,17 @@
{
tSirMacAddr peerMac;
int channel;
+
mutex_lock(&pHddCtx->tdls_lock);
connPeer = wlan_hdd_tdls_get_connected_peer(pAdapter);
+
+ if (connPeer == NULL) {
+ mutex_unlock(&pHddCtx->tdls_lock);
+ hddLog(VOS_TRACE_LEVEL_ERROR,
+ "%s connPeer is NULL", __func__);
+ return -EINVAL;
+ }
+
vos_mem_copy(peerMac, connPeer->peerMac, sizeof(tSirMacAddr));
channel = connPeer->peerParams.channel;