Explorar o código

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 %!s(int64=7) %!d(string=hai) anos
pai
achega
788a37e3c1
Modificáronse 1 ficheiros con 6 adicións e 5 borrados
  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