Преглед изворни кода

qcacld-3.0: Safely reject sched scan requests in ftm mode

Sched scan start and stop requests are coming in FTM mode
and hence do not access dev->name and reject the request
if driver is in FTM mode.

Change-Id: Ia6a3b4dc2f7c491ecc3d2456238c6583d863c10d
CRs-Fixed: 2345908
Rajeev Kumar пре 6 година
родитељ
комит
a906529e9a
1 измењених фајлова са 8 додато и 4 уклоњено
  1. 8 4
      core/hdd/src/wlan_hdd_scan.c

+ 8 - 4
core/hdd/src/wlan_hdd_scan.c

@@ -1282,7 +1282,7 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
 	struct hdd_context *hdd_ctx;
 	int ret;
 
-	hdd_enter_dev(dev);
+	hdd_enter();
 
 	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
 		hdd_err("Command not allowed in FTM mode");
@@ -1346,8 +1346,6 @@ int wlan_hdd_sched_scan_stop(struct net_device *dev)
 	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 	struct hdd_context *hdd_ctx;
 
-	hdd_enter_dev(dev);
-
 	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
 		hdd_err("Command not allowed in FTM mode");
 		return -EINVAL;
@@ -1385,7 +1383,13 @@ static int __wlan_hdd_cfg80211_sched_scan_stop(struct net_device *dev)
 	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 	int errno;
 
-	hdd_enter_dev(dev);
+	hdd_enter();
+
+	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
+		hdd_err_rl("Command not allowed in FTM mode");
+		return -EINVAL;
+	}
+
 
 	/* The return 0 is intentional when Recovery and Load/Unload in
 	 * progress. We did observe a crash due to a return of