Jelajahi Sumber

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
psimha 7 tahun lalu
induk
melakukan
deea0a130c
2 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 2 2
      core/cds/src/cds_api.c
  2. 2 2
      core/hdd/src/wlan_hdd_main.c

+ 2 - 2
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;
 }

+ 2 - 2
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;