summaryrefslogtreecommitdiff
path: root/monitor/att.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-05-20 16:17:11 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-05-20 17:23:08 -0700
commiteb47cb5a04cb1db3b87374c0cda799b7e3ef65af (patch)
treed96d03a59bff875611235f3bc3468d0a269df95d /monitor/att.c
parentf1069c4fe1060dec1565eef3d2b1ec31ed713fba (diff)
downloadbluez-eb47cb5a04cb1db3b87374c0cda799b7e3ef65af.tar.gz
monitor/att: Fix not removing read from queue
The code was using queue_find instead of queue_remove_if so follow up read wouldn't match the attribute properly.
Diffstat (limited to 'monitor/att.c')
-rw-r--r--monitor/att.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/monitor/att.c b/monitor/att.c
index f1af420ba..10d3d9e91 100644
--- a/monitor/att.c
+++ b/monitor/att.c
@@ -542,7 +542,7 @@ static void att_read_req(const struct l2cap_frame *frame)
return;
handler = get_handler(attr);
- if (!handler)
+ if (!handler || !handler->read)
return;
conn = packet_get_conn_data(frame->handle);
@@ -581,11 +581,13 @@ static void att_read_rsp(const struct l2cap_frame *frame)
data = conn->data;
- read = queue_find(data->reads, match_read_frame, frame);
+ read = queue_remove_if(data->reads, match_read_frame, (void *)frame);
if (!read)
return;
read->func(frame);
+
+ free(read);
}
static void att_read_blob_req(const struct l2cap_frame *frame)