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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(+)

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)
-- 
2.34.1





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux