wifi: If scanning, unref the device when removing wifi driver.
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fri, 25 May 2012 08:17:40 +0000 (11:17 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 25 May 2012 11:54:30 +0000 (14:54 +0300)
plugins/wifi.c

index 526bb9e..ee11413 100644 (file)
@@ -238,6 +238,10 @@ static void wifi_remove(struct connman_device *device)
 
        stop_autoscan(device);
 
+       /* In case of a user scan, device is still referenced */
+       if (connman_device_get_scanning(device) == TRUE)
+               connman_device_unref(wifi->device);
+
        iface_list = g_list_remove(iface_list, wifi);
 
        remove_networks(device, wifi);