qcacld-3.0: Add load/unload status check before wlan_hdd_mgmt_tx

If wlan_hdd_mgmt_tx is called while unload in progress, it is possible
ROC scan can't be canceled, cds_ssr_protect already prevent
wlan_hdd_mgmt_tx running before unloading, we must also prevent it
running after it.

Change-Id: Ic8d981c9be2a2b33079c4e3c9a18a4d8bce48956
CRs-Fixed: 2202026
This commit is contained in:
Will Huang
2018-02-28 15:35:33 +08:00
committed by nshrivas
parent 3ed00d11ba
commit 5561cb3c00

View File

@@ -226,9 +226,11 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
QDF_STATUS status; QDF_STATUS status;
struct net_device *dev = wdev->netdev; struct net_device *dev = wdev->netdev;
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
uint8_t type; uint8_t type;
uint8_t sub_type; uint8_t sub_type;
QDF_STATUS qdf_status; QDF_STATUS qdf_status;
int ret;
ENTER(); ENTER();
@@ -242,6 +244,12 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
return -EINVAL; return -EINVAL;
} }
ret = wlan_hdd_validate_context(hdd_ctx);
if (ret) {
hdd_err("wlan_hdd_validate_context return:%d", ret);
return ret;
}
type = WLAN_HDD_GET_TYPE_FRM_FC(buf[0]); type = WLAN_HDD_GET_TYPE_FRM_FC(buf[0]);
sub_type = WLAN_HDD_GET_SUBTYPE_FRM_FC(buf[0]); sub_type = WLAN_HDD_GET_SUBTYPE_FRM_FC(buf[0]);