[PATCH v3 2/3] gatt: Fix attempting to create device on disconnection

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

If ATT is disconnected and the state points to an invalid device it
must have been destroyed in the meantime and should not be recreated.
---
 src/gatt-database.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gatt-database.c b/src/gatt-database.c
index abcf7b759..febc2f840 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -326,8 +326,8 @@ static void att_disconnected(int err, void *user_data)
 
 	state->disc_id = 0;
 
-	device = btd_adapter_get_device(state->db->adapter, &state->bdaddr,
-					state->bdaddr_type);
+	device = btd_adapter_find_device(state->db->adapter, &state->bdaddr,
+							state->bdaddr_type);
 	if (!device)
 		goto remove;
 
-- 
2.17.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