[PATCH 06/10] wpa_supplicant: Handle race condition in sched_scan stop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Roee Zamir <roee.zamir@xxxxxxxxx>

In case that stop sched command is sent after the completion of
scheduled scan and before the processing of the
EVENT_SCHED_SCAN_STOPPED event, stopping the scheduled scan would
fail, in such a case do not set the sched_scan_stop_req flag.

Signed-off-by: Roee Zamir <roee.zamir@xxxxxxxxx>
---
 wpa_supplicant/scan.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 2f4621f..afda35e 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -2550,7 +2550,14 @@ int wpas_stop_pno(struct wpa_supplicant *wpa_s)
 		return 0;
 
 	ret = wpa_supplicant_stop_sched_scan(wpa_s);
-	wpa_s->sched_scan_stop_req = 1;
+
+	/* In case that stop sched command is sent after the completion of
+	 * sched scan and before processing the EVENT_SCHED_SCAN_STOPPED event,
+	 * stopping the scheduled scan would fail.
+	 * In such a case do not set the flag
+	 */
+	if (!ret)
+		wpa_s->sched_scan_stop_req = 1;
 
 	wpa_s->pno = 0;
 	wpa_s->pno_sched_pending = 0;
-- 
1.9.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux