Parent: f0d0266acd9d0f91f8b68ebcbf9cf0e99f62956c
Author: Ludovico de Nittis <ludovico.denittis@collabora.com>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2025-01-30 18:21:12
Tree: 8c930c1586a49a364eebb28b90c70dcfa549233a
adapter: Fix the pending changing flags check When checking if the new desired device flags are already pending, we should compare them against the XOR of current flags and desired flags, i.e. the flags that are going to change. For example, let's assume the following situation: - We have a device with `current_flags == DEVICE_FLAG_REMOTE_WAKEUP` (i.e. 1) - We want to disable the `wake_allowed` property - `device_set_wake_allowed()` will call `adapter_set_device_flags()` with `flags == 0` - When in `adapter_set_device_flags()`, we'll have: - current == 1 - pending == 0 - flags == 0 In this situation `flags == (flags & pending)` would not return what we'd expect.
Diffstat
| M | src/adapter.c | | | 3 | ++- |
1 files changed, 2 insertions(+), 1 deletions(-)