From aaded4836e0f1667ce3a25ae0fd60f2b701d15b5 Mon Sep 17 00:00:00 2001 From: Jingxiang Ge Date: Wed, 11 Sep 2019 20:02:37 +0800 Subject: [PATCH] qcacld-3.0: Fix pdev object leak when wma ready event timeout If wma ready event timeout, and pdev has been created but not yet finished wmi_ready, so it will cause pdev object leak. Fix is to release pdev without checking if wmi ready here. Change-Id: Ib03a7a2733cd399064d68e4cb5ff8f699be62024 CRs-Fixed: 2525749 --- core/hdd/src/wlan_hdd_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 24af2fec551b..a51eccc82b56 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3133,7 +3133,6 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit) QDF_STATUS status; bool unint = false; void *hif_ctx; - struct target_psoc_info *tgt_hdl; qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); if (!qdf_dev) { @@ -3338,10 +3337,9 @@ deregister_cb: hdd_deregister_cb(hdd_ctx); cds_txrx_free: - tgt_hdl = wlan_psoc_get_tgt_if_handle(hdd_ctx->psoc); - if (tgt_hdl && target_psoc_get_wmi_ready(tgt_hdl)) { - hdd_runtime_suspend_context_deinit(hdd_ctx); + hdd_runtime_suspend_context_deinit(hdd_ctx); + if (hdd_ctx->pdev) { dispatcher_pdev_close(hdd_ctx->pdev); hdd_objmgr_release_and_destroy_pdev(hdd_ctx); }