Ver Fonte

qcacld-3.0: Destroy pdev after all vdev free

Currently, pdev destroy is before cds_close and
scheduler_disable. Some pending msg in scheduler
may hold ref count on vdev.
scheduler_flush_mqs will release all the vdev ref
and get vdev freed.
That may cause pdev freed before vdev and get
issue in wlan_objmgr_vdev_obj_free.

Fix by destroy pdev after all possible vdev ref
released (cds_close).

Change-Id: I8e898f6c63fa298f2c63c5fc19706208b8580a60
CRs-Fixed: 2156577
Liangwei Dong há 7 anos atrás
pai
commit
50a64a7bdd
1 ficheiros alterados com 13 adições e 13 exclusões
  1. 13 13
      core/hdd/src/wlan_hdd_main.c

+ 13 - 13
core/hdd/src/wlan_hdd_main.c

@@ -10132,19 +10132,6 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode)
 
 	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);
-		QDF_ASSERT(0);
-	}
-
-	/*
-	 * Reset total mac phy during module stop such that during
-	 * next module start same psoc is used to populate new service
-	 * ready data
-	 */
-	hdd_ctx->hdd_psoc->total_mac_phy = 0;
-
 	qdf_status = cds_dp_close(hdd_ctx->hdd_psoc);
 	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
 		hdd_warn("Failed to stop CDS DP: %d", qdf_status);
@@ -10159,6 +10146,19 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode)
 		QDF_ASSERT(0);
 	}
 
+	ret = hdd_objmgr_release_and_destroy_pdev(hdd_ctx);
+	if (ret) {
+		hdd_err("Failed to destroy pdev; errno:%d", ret);
+		QDF_ASSERT(0);
+	}
+
+	/*
+	 * Reset total mac phy during module stop such that during
+	 * next module start same psoc is used to populate new service
+	 * ready data
+	 */
+	hdd_ctx->hdd_psoc->total_mac_phy = 0;
+
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
 	if (!hif_ctx) {
 		hdd_err("Hif context is Null");