diff mbox series

P2P: Clear pending_listen_freq when stopping listen

Message ID 20210307214002.29126-2-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series P2P: Clear pending_listen_freq when stopping listen | expand

Commit Message

Andrei Otcheretianski March 7, 2021, 9:40 p.m. UTC
If listen work never started, pending_listen_freq might be left
uncleared, preventing the subsequent listen to start.
This could happen in p2p_timeout_wait_peer_idle() after the commit
13256b8cf ("P2P: Stop old listen radio work before go to WAIT_PEER_IDLE
state") added a stop_listen() call there.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
---
 src/p2p/p2p.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jouni Malinen March 12, 2021, 9:50 a.m. UTC | #1
On Sun, Mar 07, 2021 at 11:40:02PM +0200, Andrei Otcheretianski wrote:
> If listen work never started, pending_listen_freq might be left
> uncleared, preventing the subsequent listen to start.
> This could happen in p2p_timeout_wait_peer_idle() after the commit
> 13256b8cf ("P2P: Stop old listen radio work before go to WAIT_PEER_IDLE
> state") added a stop_listen() call there.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 81bb937b36..b94274146e 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -3994,6 +3994,7 @@  static void p2p_timeout_wait_peer_idle(struct p2p_data *p2p)
 
 	p2p_dbg(p2p, "Go to Listen state while waiting for the peer to become ready for GO Negotiation");
 	p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+	p2p->pending_listen_freq = 0;
 	p2p_set_state(p2p, P2P_WAIT_PEER_CONNECT);
 	p2p_listen_in_find(p2p, 0);
 }