diff options
| -rw-r--r-- | core/hdd/src/wlan_hdd_hostapd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 78c9df6f9e20..a24bc1221d6e 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7800,7 +7800,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; @@ -7819,6 +7819,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; @@ -7837,7 +7842,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; |
