diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index b196e6fdd..6a48dba6b 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -2245,11 +2245,7 @@ void p2p_deinit(struct p2p_data *p2p) void p2p_flush(struct p2p_data *p2p) { struct p2p_device *dev, *prev; - p2p_clear_timeout(p2p); - p2p_set_state(p2p, P2P_IDLE); - p2p->start_after_scan = P2P_AFTER_SCAN_NOTHING; - p2p->go_neg_peer = NULL; - eloop_cancel_timeout(p2p_find_timeout, p2p, NULL); + p2p_stop_find(p2p); dl_list_for_each_safe(dev, prev, &p2p->devices, struct p2p_device, list) { dl_list_del(&dev->list);