qcacld-3.0: Validate adapter before sched scan stop

wlan_hdd_cfg80211_sched_scan_stop() currently does not validate the
given adapter or the hdd context. Validate both before performing a
scheduled scan stop operation on said adapter.

Change-Id: I4e0370ad059fbb0371a38300f33dfae7a9f8106d
CRs-Fixed: 2289411
This commit is contained in:
Dustin Brown
2018-08-02 17:35:02 -07:00
committed by nshrivas
parent af5a0e7212
commit a31fa1103b

View File

@@ -1351,7 +1351,8 @@ int wlan_hdd_sched_scan_stop(struct net_device *dev)
*/
static int __wlan_hdd_cfg80211_sched_scan_stop(struct net_device *dev)
{
int err;
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
int errno;
hdd_enter_dev(dev);
@@ -1377,10 +1378,19 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct net_device *dev)
return 0;
}
err = wlan_hdd_sched_scan_stop(dev);
errno = hdd_validate_adapter(adapter);
if (errno)
return errno;
errno = wlan_hdd_validate_context(WLAN_HDD_GET_CTX(adapter));
if (errno)
return errno;
errno = wlan_hdd_sched_scan_stop(dev);
hdd_exit();
return err;
return errno;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)