From: Samuel Ortiz Date: Wed, 22 Dec 2010 19:45:18 +0000 (+0100) Subject: wifi: Remove misleading error string X-Git-Tag: 2.0_alpha~1963 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54deac67cf2bfdf33a267e96d9159ea10c10518e;p=framework%2Fconnectivity%2Fconnman.git 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. --- diff --git a/plugins/wifi.c b/plugins/wifi.c index cced65b..7b629e9 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; }