From 795883e98eba3c0b2e196aaeb744ef18e887617f Mon Sep 17 00:00:00 2001 From: "VAUTRIN Emmanuel (Canal Plus Prestataire)" Date: Tue, 9 Feb 2021 17:46:20 +0000 Subject: wifi: Check valid network in disconnect callback Check the involved network validity in disconnect callback, to avoid side effects, as crashing, when processing an already released one. Fixes: dd86f09107e8 ("wifi: Always disconnect connection completely") --- plugins/wifi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/wifi.c b/plugins/wifi.c index 6233fe11..1a0781a6 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -2263,7 +2263,8 @@ static void disconnect_callback(int result, GSupplicantInterface *interface, return; } - connman_network_set_connected(network, false); + if (g_slist_find(wifi->networks, network)) + connman_network_set_connected(network, false); if (network != wifi->network) { if (network == wifi->pending_network) -- cgit v1.2.1