From ef902c5f7ec2abf11b171e862743eab110f59385 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Tue, 29 Sep 2020 18:37:08 +0200 Subject: [PATCH] p2p: Fix adding peers from Probe Request info Make sure dev->peer_list is non-NULL before using l_queue_push_tail() same as we do when the peer info comes from a Probe Response (active scan in Find Phase). Otherwise peers discovered through Probe Requests before any Probe Responses are received will be lost. --- src/p2p.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p2p.c b/src/p2p.c index 6182cda9..662fdb61 100644 --- a/src/p2p.c +++ b/src/p2p.c @@ -3747,6 +3747,9 @@ static void p2p_device_probe_cb(const struct mmpdu_header *mpdu, */ peer->device_addr = bss->addr; + if (!dev->peer_list) + dev->peer_list = l_queue_new(); + if (!p2p_device_peer_add(dev, peer)) p2p_peer_free(peer);