Diff between 6a8f7c55dfdfed8136ba8b417d0d8ee45181001a and 670f0d0f618d3f122e6d95c34de53f59a343a15f

Changed Files

File Additions Deletions Status
src/shared/gatt-client.c +4 -3 modified

Full Patch

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index efc013a..5de679c 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -2232,11 +2232,11 @@ static void notify_cb(struct bt_att_chan *chan, uint8_t opcode,
 	struct bt_gatt_client *client = user_data;
 	struct value_data data;
 
-	if (queue_isempty(client->notify_list))
-		return;
-
 	bt_gatt_client_ref(client);
 
+	if (queue_isempty(client->notify_list))
+		goto done;
+
 	memset(&data, 0, sizeof(data));
 
 	if (opcode == BT_ATT_OP_HANDLE_NFY_MULT) {
@@ -2271,6 +2271,7 @@ static void notify_cb(struct bt_att_chan *chan, uint8_t opcode,
 		queue_foreach(client->notify_list, notify_handler, &data);
 	}
 
+done:
 	if (opcode == BT_ATT_OP_HANDLE_IND && !client->parent)
 		bt_att_chan_send(chan, BT_ATT_OP_HANDLE_CONF, NULL, 0,
 							NULL, NULL, NULL);