Browse Source

qcacld-3.0: Do not flush work if it is not created

Do not flush work if it is not created.

Change-Id: If2df381b7441e08ef0d6da6176f3aeda80ec8034
CRs-Fixed: 2539867
Alan Chen 5 years ago
parent
commit
285bbc7dbb
1 changed files with 3 additions and 1 deletions
  1. 3 1
      core/hdd/src/wlan_hdd_main.c

+ 3 - 1
core/hdd/src/wlan_hdd_main.c

@@ -6159,7 +6159,9 @@ QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx)
 
 	hdd_enter();
 
-	cds_flush_work(&hdd_ctx->sap_pre_cac_work);
+	/* do not flush work if it is not created */
+	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_info("[SSR] reset adapter with device mode %s(%d)",