Diff between 52bda9d45572ab4629bf2f686616c0398f489dad and 0dc5bb2ed6798c25a451516f95c747a60014978b

Changed Files

File Additions Deletions Status
profiles/gap/gas.c +4 -4 modified

Full Patch

diff --git a/profiles/gap/gas.c b/profiles/gap/gas.c
index dbe5f00..08aaf19 100644
--- a/profiles/gap/gas.c
+++ b/profiles/gap/gas.c
@@ -342,6 +342,10 @@ static int gap_accept(struct btd_service *service)
 		goto _finish;
 	}
 
+	/* Check if attribute already has been discovered */
+	if (gas->attr)
+		goto _finish;
+
 	gas->db = gatt_db_ref(db);
 	gas->client = bt_gatt_client_clone(client);
 
@@ -364,10 +368,6 @@ _finish:
 
 static int gap_disconnect(struct btd_service *service)
 {
-	struct gas *gas = btd_service_get_user_data(service);
-
-	gas_reset(gas);
-
 	btd_service_disconnecting_complete(service, 0);
 
 	return 0;