From c42de40a3b92cdc561db80c30ec9da215197f6a5 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Fri, 31 Jul 2020 03:31:29 +0200 Subject: [PATCH] p2p: Add a null-check before use p2p_connection_reset may be called as a result of a WFD service unregistering and p2p_own_wfd is going to be NULL, don't update p2p_own_wfd->available in this case. --- src/p2p.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p2p.c b/src/p2p.c index aaecb8ee..06416bd8 100644 --- a/src/p2p.c +++ b/src/p2p.c @@ -486,7 +486,9 @@ static void p2p_connection_reset(struct p2p_device *dev) if (dev->conn_own_wfd) { l_free(dev->conn_own_wfd); dev->conn_own_wfd = NULL; - p2p_own_wfd->available = true; + + if (p2p_own_wfd) + p2p_own_wfd->available = true; } explicit_bzero(dev->conn_psk, 32);