device: Disconnect a connected network before disabling the device
authorAlok Barsode <alok.barsode@linux.intel.com>
Thu, 6 Oct 2011 11:00:38 +0000 (14:00 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 6 Oct 2011 11:24:14 +0000 (13:24 +0200)
When disabling a device, disconnect the device's connected network,
if there are any.

Fixes BCM#23165.

src/device.c

index de7b141..fedd581 100644 (file)
@@ -298,6 +298,9 @@ int __connman_device_disable(struct connman_device *device)
 
        clear_scan_trigger(device);
 
+       if (device->network)
+               connman_network_set_connected(device->network, FALSE);
+
        err = device->driver->disable(device);
        if (err == 0) {
                connman_device_set_powered(device, FALSE);