Browse Source

qcacld-3.0: Add sap_pre_cac_work check before flushing

In hdd_stop_adapter and hdd_stop_all_adapters, sap_pre_cac_work is
sometimes being flushed when it is not initialized. Put a check to only
flush if it is initialized.

Change-Id: I1e25ae06f351188c1bc45c4f94c80b3c77799b88
CRs-Fixed: 2554551
Alan Chen 5 năm trước cách đây
mục cha
commit
c2d4b1cbd9
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      core/hdd/src/wlan_hdd_main.c

+ 4 - 2
core/hdd/src/wlan_hdd_main.c

@@ -5916,7 +5916,8 @@ QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx,
 
 		/* don't flush pre-cac destroy if we are destroying pre-cac */
 		sap_ctx = WLAN_HDD_GET_SAP_CTX_PTR(adapter);
-		if (!wlan_sap_is_pre_cac_context(sap_ctx))
+		if (!wlan_sap_is_pre_cac_context(sap_ctx) &&
+		    (hdd_ctx->sap_pre_cac_work.fn))
 			cds_flush_work(&hdd_ctx->sap_pre_cac_work);
 
 		/* fallthrough */
@@ -6085,7 +6086,8 @@ QDF_STATUS hdd_stop_all_adapters(struct hdd_context *hdd_ctx)
 
 	hdd_enter();
 
-	cds_flush_work(&hdd_ctx->sap_pre_cac_work);
+	if (hdd_ctx->sap_pre_cac_work.fn)
+		cds_flush_work(&hdd_ctx->sap_pre_cac_work);
 
 	hdd_for_each_adapter(hdd_ctx, adapter)
 		hdd_stop_adapter(hdd_ctx, adapter);