From: Patrik Flykt Date: Fri, 9 Nov 2012 08:54:21 +0000 (+0200) Subject: wifi: Handle D-Bus method call failure X-Git-Tag: 1.10~200 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fconnman.git;a=commitdiff_plain;h=54f4fd02dc611aecf74bb2341ba88c94caadf6ec wifi: Handle D-Bus method call failure If -ECONNABORTED is received from the gsupplicant network disconnect callback, it's an indication that the interface has already been removed from wpa_supplicant side. This can happen due to a race condition between rtnl and wpa_supplicant interface removal when a USB WiFi dongle is pulled out. The pointers given to the callback can no longer be trusted, don't touch them in the callback. The have been removed by other code at this point. --- diff --git a/plugins/wifi.c b/plugins/wifi.c index d2ab3b0..1e9d28c 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -1238,6 +1238,14 @@ static void disconnect_callback(int result, GSupplicantInterface *interface, { struct wifi_data *wifi = user_data; + DBG("result %d supplicant interface %p wifi %p", + result, interface, wifi); + + if (result == -ECONNABORTED) { + DBG("wifi interface no longer available"); + return; + } + if (wifi->network != NULL) { /* * if result < 0 supplican return an error because