mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
qcacld-3.0: Check for adapter validity in pre cac work
Check for adapter validity for pre cac adapter close work function and hdd context validity to avoid crash during race condition in SSR case. Change-Id: I6c167e8f1a8199c63fba905fff4e781d244c7dc1 CRs-fixed: 2021403
This commit is contained in:
parent
cd64c0bf0c
commit
7ef504ef79
1 changed files with 26 additions and 13 deletions
|
|
@ -890,6 +890,40 @@ static int wlan_hdd_set_pre_cac_complete_status(hdd_adapter_t *ap_adapter,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* __wlan_hdd_sap_pre_cac_failure() - Process the pre cac failure
|
||||
* @data: AP adapter
|
||||
*
|
||||
* Deletes the pre cac adapter
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void __wlan_hdd_sap_pre_cac_failure(void *data)
|
||||
{
|
||||
hdd_adapter_t *adapter;
|
||||
hdd_context_t *hdd_ctx;
|
||||
|
||||
ENTER();
|
||||
|
||||
adapter = (hdd_adapter_t *) data;
|
||||
if (!adapter ||
|
||||
adapter->magic != WLAN_HDD_ADAPTER_MAGIC) {
|
||||
hdd_err("SAP Pre CAC adapter invalid");
|
||||
return;
|
||||
}
|
||||
|
||||
hdd_ctx = (hdd_context_t *) (adapter->pHddCtx);
|
||||
if (wlan_hdd_validate_context(hdd_ctx)) {
|
||||
hdd_err("HDD context is null");
|
||||
return;
|
||||
}
|
||||
|
||||
wlan_hdd_release_intf_addr(hdd_ctx,
|
||||
adapter->macAddressCurrent.bytes);
|
||||
hdd_stop_adapter(hdd_ctx, adapter, true);
|
||||
hdd_close_adapter(hdd_ctx, adapter, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_hdd_sap_pre_cac_failure() - Process the pre cac failure
|
||||
* @data: AP adapter
|
||||
|
|
@ -900,32 +934,11 @@ static int wlan_hdd_set_pre_cac_complete_status(hdd_adapter_t *ap_adapter,
|
|||
*/
|
||||
void wlan_hdd_sap_pre_cac_failure(void *data)
|
||||
{
|
||||
hdd_adapter_t *pHostapdAdapter;
|
||||
hdd_context_t *hdd_ctx;
|
||||
|
||||
ENTER();
|
||||
|
||||
pHostapdAdapter = (hdd_adapter_t *) data;
|
||||
if (!pHostapdAdapter) {
|
||||
hdd_err("AP adapter is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
hdd_ctx = (hdd_context_t *) (pHostapdAdapter->pHddCtx);
|
||||
if (!hdd_ctx) {
|
||||
hdd_err("HDD context is null");
|
||||
return;
|
||||
}
|
||||
|
||||
cds_ssr_protect(__func__);
|
||||
wlan_hdd_release_intf_addr(hdd_ctx,
|
||||
pHostapdAdapter->macAddressCurrent.bytes);
|
||||
hdd_stop_adapter(hdd_ctx, pHostapdAdapter, true);
|
||||
hdd_close_adapter(hdd_ctx, pHostapdAdapter, false);
|
||||
__wlan_hdd_sap_pre_cac_failure(data);
|
||||
cds_ssr_unprotect(__func__);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wlan_hdd_sap_pre_cac_success() - Process the pre cac result
|
||||
* @data: AP adapter
|
||||
|
|
|
|||
Loading…
Reference in a new issue