From 645749571dfe535a1056146d030e097997429e98 Mon Sep 17 00:00:00 2001 From: Sravan Kumar Kairam Date: Thu, 22 Jun 2017 11:48:18 +0530 Subject: [PATCH] qcacld-3.0: Deinitialize runtime suspend context before hif close Currently runtime suspend context deinit is done after hif close which leads to memory leak. In this change deinitialize the runtime suspend context before hif close. Change-Id: Idc99f77b09a25a53e10b4e92391060670bb9bb7e CRs-Fixed: 2065219 --- core/hdd/src/wlan_hdd_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 9156ecb983ab..fdd0fa3f9948 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2781,6 +2781,8 @@ static void hdd_runtime_suspend_context_deinit(hdd_context_t *hdd_ctx) ctx->roc = NULL; qdf_runtime_lock_deinit(ctx->dfs); ctx->dfs = NULL; + + wlan_scan_runtime_pm_deinit(hdd_ctx->hdd_pdev); } static void hdd_adapter_runtime_suspend_init(hdd_adapter_t *adapter) @@ -5582,7 +5584,6 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx) hdd_green_ap_deinit(hdd_ctx); hdd_request_manager_deinit(); - hdd_runtime_suspend_context_deinit(hdd_ctx); hdd_close_all_adapters(hdd_ctx, false); hdd_ipa_cleanup(hdd_ctx); @@ -9175,6 +9176,8 @@ int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool ftm_mode) ret = -EINVAL; } + hdd_runtime_suspend_context_deinit(hdd_ctx); + hdd_hif_close(hdd_ctx, hif_ctx); ol_cds_free();