diff mbox series

[BlueZ,1/1] device: Fix rare ERR_BREDR_CONN_BUSY during connect

Message ID 20250414115017.116579-2-ovlevin@salutedevices.com (mailing list archive)
State New
Headers show
Series device: Fix rare ERR_BREDR_CONN_BUSY during connect | 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

Oleg Lyovin April 14, 2025, 11:50 a.m. UTC
Disconnect may happen while the connection to the device is not
finished, leading to device->pending list is not being freed. As a
result, subsequent connection attempts leads to ERR_BREDR_CONN_BUSY
error, making it impossible to establish a connection.

This patch frees device->pending list in such case.
---
 src/device.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

bluez.test.bot@gmail.com April 14, 2025, 1:50 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=953043

---Test result---

Test Summary:
CheckPatch                    PENDING   0.25 seconds
GitLint                       PENDING   0.24 seconds
BuildEll                      PASS      20.35 seconds
BluezMake                     PASS      2594.14 seconds
MakeCheck                     PASS      20.22 seconds
MakeDistcheck                 PASS      196.59 seconds
CheckValgrind                 PASS      273.29 seconds
CheckSmatch                   PASS      300.77 seconds
bluezmakeextell               PASS      128.38 seconds
IncrementalBuild              PENDING   0.30 seconds
ScanBuild                     PASS      892.02 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/device.c b/src/device.c
index b82a905f9..a6840440c 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1907,6 +1907,10 @@  void device_request_disconnect(struct btd_device *device, DBusMessage *msg)
 		g_dbus_send_message(dbus_conn, reply);
 		dbus_message_unref(device->connect);
 		device->connect = NULL;
+
+		/* Connection does not exists anymore, so free pending services */
+		g_slist_free(device->pending);
+		device->pending = NULL;
 	}
 
 	if (btd_device_is_connected(device) && msg)