diff options
| author | Dustin Brown <dustinb@codeaurora.org> | 2017-02-01 17:43:03 -0800 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2017-02-02 15:29:23 -0800 |
| commit | 53e12d03fb251ce25dc836957deed4fe496f4b89 (patch) | |
| tree | 2958ac0f07be593985de7f8092c831f4ad3c5472 | |
| parent | 304e400ee3ea7f8257b0325b1f60df8930a83aad (diff) | |
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
| -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; |
