From: Johannes Berg Date: Sun, 10 Oct 2010 14:52:13 +0000 (+0300) Subject: P2P: Fix remain-on-channel abort race X-Git-Url: http://www.project-moonshot.org/gitweb/?p=libeap.git;a=commitdiff_plain;h=6cb22d2fd19a032f1c85c79dbd0ee7d43b6a1a83 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 --- 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;