mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
device: Don't return an error on no state change
If device is already disconnected or in autoconnect mode, don't return an error if .Disconnect is called. Instead simply silently return success after disabling autoconnect.
This commit is contained in:
parent
73e0394d7f
commit
5b8f052524
@ -1883,6 +1883,10 @@ static struct l_dbus_message *device_dbus_disconnect(struct l_dbus *dbus,
|
||||
*/
|
||||
device_set_autoconnect(device, false);
|
||||
|
||||
if (device->state == DEVICE_STATE_AUTOCONNECT ||
|
||||
device->state == DEVICE_STATE_DISCONNECTED)
|
||||
return l_dbus_message_new_method_return(message);
|
||||
|
||||
result = device_disconnect(device);
|
||||
if (result < 0)
|
||||
return dbus_error_from_errno(result, message);
|
||||
|
Loading…
Reference in New Issue
Block a user