Diff between 95049a1816d9d963988f3209b299edc53bd5dc44 and 4064a3e98d5e973f8865cc7e2fb7bf7204b69c95

Changed Files

File Additions Deletions Status
src/device.c +3 -3 modified

Full Patch

diff --git a/src/device.c b/src/device.c
index 9021914..1f7c895 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4726,12 +4726,12 @@ bool device_attach_att(struct btd_device *dev, GIOChannel *io)
 	dst = device_get_address(dev);
 	ba2str(dst, dstaddr);
 
-	if (gatt_db_isempty(dev->db))
-		load_gatt_db(dev, srcaddr, dstaddr);
-
 	gatt_client_init(dev);
 	gatt_server_init(dev, btd_gatt_database_get_db(database));
 
+	if (gatt_db_isempty(dev->db))
+		load_gatt_db(dev, srcaddr, dstaddr);
+
 	/*
 	 * Remove the device from the connect_list and give the passive
 	 * scanning another chance to be restarted in case there are