summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiran Kumar Lokere <klokere@codeaurora.org>2017-09-14 15:19:14 -0700
committersnandini <snandini@codeaurora.org>2017-09-20 14:17:12 -0700
commitd30f09eec9685c0d71f1e7587d3870d8aefb3ec0 (patch)
treed23d5aa9e3555e75cd8e9ec855dd3080d3868735
parentea66664bdcb1333daad566dd61d0b6f28200ca9c (diff)
qcacld-3.0: Flush the delayed acs work during adapter deinit
Flush the delayed acs work during the adapter deinit process. Change-Id: I9b415a9d1b4f59b4f028e882ad09cf7f782e67b6 CRs-Fixed: 2109432
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c11
-rw-r--r--core/hdd/src/wlan_hdd_main.c5
2 files changed, 14 insertions, 2 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 53ead81d1a21..b27327fe6852 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -1460,11 +1460,16 @@ static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work);
static int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter)
{
- hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
+ hdd_context_t *hdd_ctx;
tsap_Config_t *sap_config;
tpWLAN_SAPEventCB acs_event_callback;
int status;
+ if (!adapter) {
+ hdd_err("adapater is NULL");
+ return -EINVAL;
+ }
+ hdd_ctx = WLAN_HDD_GET_CTX(adapter);
sap_config = &adapter->sessionCtx.ap.sapConfig;
if (hdd_ctx->acs_policy.acs_channel)
sap_config->channel = hdd_ctx->acs_policy.acs_channel;
@@ -1820,6 +1825,9 @@ static void wlan_hdd_cfg80211_start_pending_acs(struct work_struct *work)
{
hdd_adapter_t *adapter = container_of(work, hdd_adapter_t,
acs_pending_work.work);
+ if (!adapter)
+ return;
+ clear_bit(ACS_PENDING, &adapter->event_flags);
wlan_hdd_cfg80211_start_acs(adapter);
}
@@ -1951,7 +1959,6 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(hdd_adapter_t *adapter)
/* Lets give 500ms for OBSS + START_BSS to complete */
schedule_delayed_work(&con_sap_adapter->acs_pending_work,
msecs_to_jiffies(500));
- clear_bit(ACS_PENDING, &con_sap_adapter->event_flags);
}
}
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 9e766f9c9031..066e67dc611f 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -4149,6 +4149,11 @@ QDF_STATUS hdd_stop_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
cds_flush_work(&hdd_ctx->sap_start_work);
hdd_debug("Canceled the pending SAP restart work");
cds_change_sap_restart_required_status(false);
+ if (test_bit(ACS_PENDING, &adapter->event_flags)) {
+ cds_flush_delayed_work(
+ &adapter->acs_pending_work);
+ clear_bit(ACS_PENDING, &adapter->event_flags);
+ }
}
/* Any softap specific cleanup here... */
if (adapter->device_mode == QDF_P2P_GO_MODE)