瀏覽代碼

qcacld-3.0: Fix race condition between scan and SSR/driver unload

HDD validate context check is at wrong place in __wlan_hdd_cfg80211_scan()
which is leading to invalid pointer access and page fault. Move HDD
validate context check at begining of scan API to avoid accessing any
context pointer which is getting freed during SSR/driver unload.

Change-Id: Id91c9ea54c513ecc25bdf42904a5bb5cde2e91ce
CRs-Fixed: 1025498
Rajeev Kumar 9 年之前
父節點
當前提交
46d26b7fcf
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      core/hdd/src/wlan_hdd_scan.c

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

@@ -1271,6 +1271,11 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
+	status = wlan_hdd_validate_context(pHddCtx);
+
+	if (0 != status)
+		return status;
+
 	MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
 			 TRACE_CODE_HDD_CFG80211_SCAN,
 			 pAdapter->sessionId, request->n_channels));
@@ -1282,10 +1287,6 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 		hdd_device_mode_to_string(pAdapter->device_mode),
 		pAdapter->device_mode);
 
-	status = wlan_hdd_validate_context(pHddCtx);
-
-	if (0 != status)
-		return status;
 
 	cfg_param = pHddCtx->config;
 	pScanInfo = &pAdapter->scan_info;