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
This commit is contained in:
Jingxiang Ge 2020-02-26 20:03:54 +08:00 • committed by nshrivas
commit 57c4bf2896

View file

@ -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");