The __connman_device_disable() was checking in the start of the function
whether the driver supports disabling at all. This is too soon as
if the driver has not set the disable callback, the disconnection
of driver connections would not be done at all in that case.
---
 src/device.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/device.c b/src/device.c
index f9fc848..b455f4e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -221,9 +221,6 @@ int __connman_device_disable(struct connman_device *device)
 
        DBG("device %p", device);
 
-       if (!device->driver || !device->driver->disable)
-               return -EOPNOTSUPP;
-
        /* Ongoing power enable request */
        if (device->powered_pending == PENDING_ENABLE)
                return -EBUSY;
@@ -246,6 +243,9 @@ int __connman_device_disable(struct connman_device *device)
                        connman_network_set_connected(device->network, false);
        }
 
+       if (!device->driver || !device->driver->disable)
+               return -EOPNOTSUPP;
+
        err = device->driver->disable(device);
        if (err == 0 || err == -EALREADY) {
                connman_device_set_powered(device, false);
-- 
1.8.3.1

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to