From: Patrik Flykt <[email protected]>

Interface create and remove callbacks can be called with wifi user data
set to NULL, add checks for this.
---
 plugins/wifi.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/plugins/wifi.c b/plugins/wifi.c
index f3ea836..fa8eabd 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -200,10 +200,11 @@ static void interface_create_callback(int result,
 {
        struct wifi_data *wifi = user_data;
 
-       DBG("result %d ifname %s", result,
-                               g_supplicant_interface_get_ifname(interface));
+       DBG("result %d ifname %s, wifi %p", result,
+                               g_supplicant_interface_get_ifname(interface),
+                               wifi);
 
-       if (result < 0)
+       if (result < 0 || wifi == NULL)
                return;
 
        wifi->interface = interface;
@@ -216,9 +217,9 @@ static void interface_remove_callback(int result,
 {
        struct wifi_data *wifi = user_data;
 
-       DBG("result %d", result);
+       DBG("result %d wifi %p", result, wifi);
 
-       if (result < 0)
+       if (result < 0 || wifi == NULL)
                return;
 
        wifi->interface = NULL;
-- 
1.7.2.5

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to