From deea0a130c1b1ffb0afb10e17c7e94d9abc3fbfb Mon Sep 17 00:00:00 2001 From: psimha Date: Mon, 18 Dec 2017 14:50:02 -0800 Subject: [PATCH] qcacld-3.0: Add fixes to prevent NULL pdev access on module stop - Change the order of the deinit code of pktlog - Change the order of the deinit code of runtime pm Change-Id: I570b20b247b7892f9bba82f3d3a58aff9af09105 CRs-Fixed: 2160794 --- core/cds/src/cds_api.c | 4 ++-- core/hdd/src/wlan_hdd_main.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 0f721f246f65..0c9487534179 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1217,10 +1217,10 @@ QDF_STATUS cds_dp_close(struct wlan_objmgr_psoc *psoc) cdp_txrx_intr_detach(gp_cds_context->dp_soc); ctx = cds_get_context(QDF_MODULE_ID_TXRX); - cds_set_context(QDF_MODULE_ID_TXRX, NULL); - pmo_ucfg_psoc_set_txrx_handle(psoc, NULL); cdp_pdev_detach(cds_get_context(QDF_MODULE_ID_SOC), (struct cdp_pdev *)ctx, 1); + cds_set_context(QDF_MODULE_ID_TXRX, NULL); + pmo_ucfg_psoc_set_txrx_handle(psoc, NULL); return QDF_STATUS_SUCCESS; } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index e1393c648d44..53219c8b576d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9971,6 +9971,8 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) QDF_ASSERT(0); } + hdd_runtime_suspend_context_deinit(hdd_ctx); + ret = hdd_objmgr_release_and_destroy_pdev(hdd_ctx); if (ret) { hdd_err("Failed to destroy pdev; errno:%d", ret); @@ -10004,8 +10006,6 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) ret = -EINVAL; } - hdd_runtime_suspend_context_deinit(hdd_ctx); - if (hdd_ctx->target_hw_name) { qdf_mem_free(hdd_ctx->target_hw_name); hdd_ctx->target_hw_name = NULL;