wifi: Set wifi device powered FALSE when removed
authorYu A Wang <arron.wang@intel.com>
Thu, 8 Dec 2011 07:31:15 +0000 (02:31 -0500)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 16 Dec 2011 18:51:53 +0000 (19:51 +0100)
In interface_removed function, connman_device_set_powered may not be
called due to wifi->device is freed before supplicant callback. This
happens when we remove the second wifi device. This may lead technology
refcount inbalance, which could potentially prevent the wifi technology to
be enabled again.

plugins/wifi.c

index a905980..5f41b25 100644 (file)
@@ -196,6 +196,7 @@ static void wifi_remove(struct connman_device *device)
 
        remove_networks(device, wifi);
 
+       connman_device_set_powered(device, FALSE);
        connman_device_set_data(device, NULL);
        connman_device_unref(wifi->device);
        connman_rtnl_remove_watch(wifi->watch);