summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgaolez <gaolez@codeaurora.org>2018-06-30 13:45:04 +0800
committergaolez <gaolez@codeaurora.org>2018-07-03 15:21:35 +0800
commitd797ba13a32e6c1ceb6bf4e4cc63a68f47cc7a14 (patch)
tree3c86b45ec6d527afe4dfa44e2ffb17b371881bb9
parenta3c3a33fef7bfaa2cc5b55e3698e594dc5c50999 (diff)
qcacld-2.0: Fix timer leak issue in tsf
The capture tsf request timer will be deleted when the timer timeout or receive the tsf event. So if unload wlan driver before timer timeout or receive the tsf event, the timer will not be destory. This change will destory capture tsf request timer when wlan driver unload. Change-Id: If4178df57ea93eff053351e514753c0e49c69996 CRs-Fixed: 2271977
-rw-r--r--CORE/HDD/src/wlan_hdd_tsf.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/CORE/HDD/src/wlan_hdd_tsf.c b/CORE/HDD/src/wlan_hdd_tsf.c
index bdb264d07645..d1cd1a753691 100644
--- a/CORE/HDD/src/wlan_hdd_tsf.c
+++ b/CORE/HDD/src/wlan_hdd_tsf.c
@@ -1305,6 +1305,10 @@ fail:
void wlan_hdd_tsf_deinit(hdd_context_t *hdd_ctx)
{
eHalStatus hal_status;
+ VOS_STATUS vos_status, ret;
+ VOS_TIMER_STATE capture_req_timer_status;
+ hdd_adapter_list_node_t *adapternode_ptr, *next_ptr;
+ hdd_adapter_t *adapter;
if (!hdd_ctx)
return;
@@ -1319,6 +1323,28 @@ void wlan_hdd_tsf_deinit(hdd_context_t *hdd_ctx)
}
wlan_hdd_tsf_plus_deinit(hdd_ctx);
+
+ vos_status = hdd_get_front_adapter(hdd_ctx, &adapternode_ptr);
+ while (NULL != adapternode_ptr &&
+ VOS_STATUS_SUCCESS == vos_status) {
+ adapter = adapternode_ptr->pAdapter;
+ vos_status =
+ hdd_get_next_adapter(hdd_ctx, adapternode_ptr, &next_ptr);
+ adapternode_ptr = next_ptr;
+ if (adapter->host_capture_req_timer.state == 0)
+ continue;
+
+ capture_req_timer_status =
+ vos_timer_getCurrentState(&adapter->host_capture_req_timer);
+ if (capture_req_timer_status != VOS_TIMER_STATE_UNUSED) {
+ vos_timer_stop(&adapter->host_capture_req_timer);
+ ret =
+ vos_timer_destroy(&adapter->host_capture_req_timer);
+ if (ret != VOS_STATUS_SUCCESS)
+ hddLog(VOS_TRACE_LEVEL_WARN,
+ FL("remove timer fail, ret: %d"), ret);
+ }
+ }
adf_os_atomic_set(&hdd_ctx->tsf_ready_flag, 0);
adf_os_atomic_set(&hdd_ctx->cap_tsf_flag, 0);
}