From f0d0266acd9d0f91f8b68ebcbf9cf0e99f62956c Mon Sep 17 00:00:00 2001 From: Ludovico de Nittis Date: Wed, 29 Jan 2025 18:22:31 +0100 Subject: [PATCH] device: Clear only the pending flags that have been applied When executing `btd_device_flags_changed()`, `dev->pending_flags` may hold additional queued flag changes. Instead of completely clearing out `dev->pending_flags`, we should only remove the bits that have been actually applied and leaving the rest as pending. --- src/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index e8bff718c..17d023a61 100644 --- a/src/device.c +++ b/src/device.c @@ -7413,7 +7413,7 @@ void btd_device_flags_changed(struct btd_device *dev, uint32_t supported_flags, dev->supported_flags = supported_flags; dev->current_flags = current_flags; - dev->pending_flags = 0; + dev->pending_flags &= ~current_flags; if (!changed_flags) return; -- 2.47.3