wifi: Remove misleading error string
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 22 Dec 2010 19:45:18 +0000 (20:45 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 22 Dec 2010 19:45:18 +0000 (20:45 +0100)
Since wpa supplicant sends the interface addition signal before calling
the interface creation callback, interface_added could perfectly be called
with the wifi pointer not set yet.

plugins/wifi.c

index cced65b..7b629e9 100644 (file)
@@ -284,10 +284,18 @@ static void interface_added(GSupplicantInterface *interface)
 
        wifi = g_supplicant_interface_get_data(interface);
 
+       /*
+        * We can get here with a NULL wifi pointer when
+        * the interface added signal is sent before the
+        * interface creation callback is called.
+        */
+       if (wifi == NULL)
+               return;
+
        DBG("ifname %s driver %s wifi %p", ifname, driver, wifi);
 
-       if (wifi == NULL || wifi->device == NULL) {
-               connman_error("Wrong wifi pointer");
+       if (wifi->device == NULL) {
+               connman_error("WiFi device not set");
                return;
        }