ソースを参照

qcacld-3.0: Reject Stop AP call if module is closed

Under situations where the driver detects wifi capabilities are not
being used, it cleans itself up transparently to the kernel and shuts
down. The kernel has been observed calling the stop AP callback in
these situations, even though no virtual devices are active, which
causes a crash. Gracefully reject the calls into stop AP by the
kernel in such cases.

Change-Id: Ic215b033526125412ebe12c0021c61b20f4c86a1
CRs-Fixed: 2001200
Dustin Brown 8 年 前
コミット
6807c74d09
1 ファイル変更6 行追加2 行削除
  1. 6 2
      core/hdd/src/wlan_hdd_hostapd.c

+ 6 - 2
core/hdd/src/wlan_hdd_hostapd.c

@@ -7773,7 +7773,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 					struct net_device *dev)
 {
 	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-	hdd_context_t *pHddCtx = NULL;
+	hdd_context_t *pHddCtx = wiphy_priv(wiphy);
 	hdd_scaninfo_t *pScanInfo = NULL;
 	hdd_adapter_t *staAdapter = NULL;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
@@ -7792,6 +7792,11 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
+	if (pHddCtx->driver_status == DRIVER_MODULES_CLOSED) {
+		hdd_err("Driver module is closed; dropping request");
+		return -EINVAL;
+	}
+
 	if (wlan_hdd_validate_session_id(pAdapter->sessionId)) {
 		hdd_err("invalid session id: %d", pAdapter->sessionId);
 		return -EINVAL;
@@ -7810,7 +7815,6 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 		hdd_device_mode_to_string(pAdapter->device_mode),
 		pAdapter->device_mode);
 
-	pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
 	ret = wlan_hdd_validate_context(pHddCtx);
 	if (0 != ret)
 		return ret;