ソースを参照

qcacld-3.0: init/deinit bug report lock appropriately

During initialization, bug report lock is initialized after logger
thread is created and during deinitialization, bug report lock is
destroyed before logger thread exits. As logger thread uses this
lock there is a possibility of logger thread to access uninitialized
lock.

To mitigate this issue initialize/deinitialize lock after/before
creating logging thread.

Change-Id: I973c9b6c7eed38cbbc09258a54e587078ddb37e1
CRs-Fixed: 2094510
Hanumanth Reddy Pothula 7 年 前
コミット
788a37e3c1
1 ファイル変更6 行追加5 行削除
  1. 6 5
      core/hdd/src/wlan_hdd_main.c

+ 6 - 5
core/hdd/src/wlan_hdd_main.c

@@ -5965,8 +5965,6 @@ static void hdd_wlan_exit(struct hdd_context *hdd_ctx)
 		hdd_stop_all_adapters(hdd_ctx);
 	}
 
-	wlan_destroy_bug_report_lock();
-
 	/*
 	 * Close the scheduler before calling cds_close to make sure
 	 * no thread is scheduled after the each module close is
@@ -9684,8 +9682,6 @@ int hdd_wlan_startup(struct device *dev)
 		goto err_hdd_free_psoc;
 	}
 
-	wlan_init_bug_report_lock();
-
 	wlan_hdd_update_wiphy(hdd_ctx);
 
 	hdd_ctx->hHal = cds_get_context(QDF_MODULE_ID_SME);
@@ -10920,6 +10916,9 @@ int hdd_init(void)
 	int ret = 0;
 
 	p_cds_context = cds_init();
+
+	wlan_init_bug_report_lock();
+
 #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
 	wlan_logging_sock_init_svc();
 #endif
@@ -10949,13 +10948,15 @@ err_out:
 void hdd_deinit(void)
 {
 	hdd_deinit_wowl();
-	cds_deinit();
 
 	hdd_qdf_print_deinit();
 
 #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
 	wlan_logging_sock_deinit_svc();
 #endif
+
+	wlan_destroy_bug_report_lock();
+	cds_deinit();
 }
 
 #ifdef QCA_WIFI_NAPIER_EMULATION