From 54deac67cf2bfdf33a267e96d9159ea10c10518e Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 22 Dec 2010 20:45:18 +0100 Subject: 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. --- plugins/wifi.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'plugins') 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; } -- cgit v1.2.3