From 6cb22d2fd19a032f1c85c79dbd0ee7d43b6a1a83 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sun, 10 Oct 2010 17:52:13 +0300 Subject: [PATCH] P2P: Fix remain-on-channel abort race When the P2P state machine requests a remain- on-channel, there's a potential race where it can then request a stop before the r-o-c has actually started, in which case the stop will not be processed. Fix that. Signed-off-by: Johannes Berg --- wpa_supplicant/p2p_supplicant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index da90c28..3fb872d 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -1048,7 +1048,7 @@ static int wpas_start_listen(void *ctx, unsigned int freq, static void wpas_stop_listen(void *ctx) { struct wpa_supplicant *wpa_s = ctx; - if (wpa_s->off_channel_freq) { + if (wpa_s->off_channel_freq || wpa_s->roc_waiting_drv_freq) { wpa_drv_cancel_remain_on_channel(wpa_s); wpa_s->off_channel_freq = 0; wpa_s->roc_waiting_drv_freq = 0; -- 2.1.4