Browse Source

qcacld-3.0: Dont process uevent request when the modules are closed

When the SSR is triggered after the modules are closed, uevent
notifier is trying to get the pdev which is alredy destroyed.

Reject the uevent notification if the modules are already closed.

Change-Id: I8074838b18b1e36dd67afa90125f9fbe06d32c34
CRs-Fixed: 2219843
Arunk Khandavalli 7 năm trước cách đây
mục cha
commit
5923cc98c8
1 tập tin đã thay đổi với 13 bổ sung5 xóa
  1. 13 5
      core/hdd/src/wlan_hdd_driver_ops.c

+ 13 - 5
core/hdd/src/wlan_hdd_driver_ops.c

@@ -1490,6 +1490,17 @@ static void wlan_hdd_handle_the_pld_uevent(struct pld_uevent_data *uevent)
 	if (cds_is_driver_loading())
 		return;
 
+	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+	if (!hdd_ctx) {
+		hdd_err("hdd_ctx is NULL return");
+		return;
+	}
+
+	if (hdd_ctx->driver_status == DRIVER_MODULES_CLOSED) {
+		hdd_info("Driver modules are already closed!");
+		return;
+	}
+
 	switch (uevent->uevent) {
 	case PLD_RECOVERY:
 		cds_set_target_ready(false);
@@ -1498,10 +1509,7 @@ static void wlan_hdd_handle_the_pld_uevent(struct pld_uevent_data *uevent)
 	case PLD_FW_DOWN:
 		qdf_complete_wait_events();
 		cds_set_target_ready(false);
-		hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-		if (hdd_ctx != NULL)
-			wlan_cfg80211_cleanup_scan_queue(
-					hdd_ctx->hdd_pdev, NULL);
+		wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev, NULL);
 		break;
 	default:
 		break;
@@ -1521,8 +1529,8 @@ static void wlan_hdd_pld_uevent(struct device *dev,
 	hdd_enter();
 	hdd_info("pld event %d", uevent->uevent);
 
-	mutex_lock(&hdd_init_deinit_lock);
 	wlan_hdd_set_the_pld_uevent(uevent);
+	mutex_lock(&hdd_init_deinit_lock);
 	wlan_hdd_handle_the_pld_uevent(uevent);
 	mutex_unlock(&hdd_init_deinit_lock);