summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2010-12-22 20:45:18 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-12-22 20:45:18 +0100
commit54deac67cf2bfdf33a267e96d9159ea10c10518e (patch)
treef9e89a0696a1ab634c228e3be865d3b75b2ca6b6 /plugins
parentce64038a4e84a81162b418b15cb8ad68f03ca41b (diff)
downloadconnman-54deac67cf2bfdf33a267e96d9159ea10c10518e.tar.gz
connman-54deac67cf2bfdf33a267e96d9159ea10c10518e.tar.bz2
connman-54deac67cf2bfdf33a267e96d9159ea10c10518e.zip
wifi: Remove misleading error string
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wifi.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index cced65b1..7b629e95 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -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;
}