Bladeren bron

qcacld-3.0: Fix wlan_start_comp reset earlier issue

Issue happens when loading driver fail, it will enter pld_deinit,
as wlan_start_comp maybe reset before waiting in
wlan_hdd_state_ctrl_param_write, so once driver is unloaded,
the completion timeout happens 20s later, it will access invalid
wlan_start_comp.

Move init wlan_start_comp when creating wlan node, so it will not
cause completion timeout.

Change-Id: I9a8f43cdf9aa4c777272b7c28f1160e993c4dce4
CRs-Fixed: 2630479
Jingxiang Ge 5 jaren geleden
bovenliggende
commit
57c4bf2896
1 gewijzigde bestanden met toevoegingen van 2 en 3 verwijderingen
  1. 2 3
      core/hdd/src/wlan_hdd_main.c

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

@@ -14208,7 +14208,6 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp,
 	}
 
 	if (!cds_is_driver_loaded()) {
-		init_completion(&wlan_start_comp);
 		rc = wait_for_completion_timeout(&wlan_start_comp,
 				msecs_to_jiffies(HDD_WLAN_START_WAIT_TIME));
 		if (!rc) {
@@ -14216,8 +14215,6 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp,
 			ret = -EINVAL;
 			return ret;
 		}
-
-		hdd_start_complete(0);
 	}
 
 exit:
@@ -14237,6 +14234,8 @@ static int  wlan_hdd_state_ctrl_param_create(void)
 	int ret;
 	struct device *dev;
 
+	init_completion(&wlan_start_comp);
+
 	device = MKDEV(wlan_hdd_state_major, 0);
 
 	ret = alloc_chrdev_region(&device, 0, dev_num, "qcwlanstate");