wlan: Acquire rtnl lock while unregistering SAP ioctls.
As part of ioctl unregister, HOST will set wireless_handlers
to NULL. This may lead to NULL pointer dereference if kernel
is processing any IOCTL simultaneously.
Hence, acquire rtnl_lock while making wireless_handlers to NULL,
as same lock is acquired while processing ioctl.
Change-Id: Ic4f54dd9b8cc1d98b0c4d4cd95e4ee24d7d6f5a4
CRs-Fixed: 788485
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 5a121ba..c67142d 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -7535,7 +7535,7 @@
if (pP2pAdapter)
{
hdd_stop_adapter(pHddCtx, pP2pAdapter, VOS_TRUE);
- hdd_deinit_adapter(pHddCtx, pP2pAdapter);
+ hdd_deinit_adapter(pHddCtx, pP2pAdapter, TRUE);
hdd_close_adapter(pHddCtx, pP2pAdapter, VOS_TRUE);
}
}
@@ -7558,7 +7558,7 @@
mutex_lock(&pHddCtx->tdls_lock);
#endif
//De-init the adapter.
- hdd_deinit_adapter( pHddCtx, pAdapter );
+ hdd_deinit_adapter( pHddCtx, pAdapter, TRUE);
memset(&pAdapter->sessionCtx, 0, sizeof(pAdapter->sessionCtx));
pAdapter->device_mode = (type == NL80211_IFTYPE_AP) ?
WLAN_HDD_SOFTAP : WLAN_HDD_P2P_GO;
@@ -7677,7 +7677,7 @@
*/
mutex_lock(&pHddCtx->tdls_lock);
#endif
- hdd_deinit_adapter( pHddCtx, pAdapter );
+ hdd_deinit_adapter( pHddCtx, pAdapter, TRUE);
wdev->iftype = type;
//Check for sub-string p2p to confirm its a p2p interface
if (NULL != strstr(ndev->name,"p2p"))