Skip to contentSkip to conversation

Fix creating device object when connection fails

PATCH In review Luiz Augusto von Dentz 2 participants 2 messages Feb 1, 2011 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH v3 1/2 Fix creating device object when connection fails

From: Luiz Augusto von Dentz <[email protected]>

There is no need to create a new object since there is no connection and the device is not permanent/paired.

---
 src/event.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
src/event.c +6 -1
index ff768c0..cbaf9d7 100644
@@ -676,7 +676,12 @@ void btd_event_conn_failed(bdaddr_t *local, bdaddr_t *peer, uint8_t status)
 	struct btd_device *device;
 	DBusConnection *conn = get_dbus_connection();
 
-	if (!get_adapter_and_device(local, peer, &adapter, &device, TRUE))
+	DBG("status 0x%02x", status);
+
+	if (!get_adapter_and_device(local, peer, &adapter, &device, FALSE))
+		return;
+
+	if (!device)
 		return;
 
 	if (device_is_temporary(device))
Signature · 1 line
1.7.1
#1 lore raw

Hi Luiz,

Quoted 5 lines · Luiz Augusto von Dentz

There is no need to create a new object since there is no connection and the device is not permanent/paired.

---
 src/event.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

Thanks. This one has been pushed upstream now. I'll skip 2/2 since it should never happen that there's a connection without a corresponding device object.

Johan