diff mbox series

[BlueZ,v2] device: Clear pending_flags on error

Message ID 20250128115659.23655-1-ludovico.denittis@collabora.com (mailing list archive)
State New
Headers show
Series [BlueZ,v2] device: Clear pending_flags on error | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Ludovico de Nittis Jan. 28, 2025, 11:56 a.m. UTC
If setting WakeAllowed, or the device privacy, fails, we may end up in a
situation where `pending_flags` is still set to some `DEVICE_FLAG_*`
values, for example from `device_set_wake_allowed()` or
`adapter_set_device_flags()`.

This can confuse further requests because they'll assume that there is
still a pending request in progress.
---
 src/adapter.c | 1 +
 src/device.c  | 1 +
 2 files changed, 2 insertions(+)

Comments

bluez.test.bot@gmail.com Jan. 28, 2025, 1:23 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=928815

---Test result---

Test Summary:
CheckPatch                    PENDING   0.31 seconds
GitLint                       PENDING   0.39 seconds
BuildEll                      PASS      20.10 seconds
BluezMake                     PASS      1497.09 seconds
MakeCheck                     PASS      12.96 seconds
MakeDistcheck                 PASS      157.10 seconds
CheckValgrind                 PASS      211.54 seconds
CheckSmatch                   PASS      269.38 seconds
bluezmakeextell               PASS      97.18 seconds
IncrementalBuild              PENDING   0.41 seconds
ScanBuild                     PASS      853.18 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/src/adapter.c b/src/adapter.c
index 5d4117a49..3eb343cbc 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -5580,6 +5580,7 @@  static void set_device_privacy_complete(uint8_t status, uint16_t length,
 	if (status != MGMT_STATUS_SUCCESS) {
 		error("Set device flags return status: %s",
 					mgmt_errstr(status));
+		btd_device_set_pending_flags(dev, 0);
 		return;
 	}
 
diff --git a/src/device.c b/src/device.c
index e8bff718c..3c2337198 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1575,6 +1575,7 @@  static void set_wake_allowed_complete(uint8_t status, uint16_t length,
 			dev->wake_id = -1U;
 		}
 		dev->pending_wake_allowed = FALSE;
+		dev->pending_flags = 0;
 		return;
 	}