From 018d852f860c415bf68897820570432ba9b0ba04 Mon Sep 17 00:00:00 2001 From: John Sullivan Date: Mon, 23 Nov 2020 11:03:05 +0000 Subject: [PATCH] avoid deadlock when handling notifications/indications --- src/bluez/attrib/gattrib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bluez/attrib/gattrib.c b/src/bluez/attrib/gattrib.c index ac5fc4b..593ddd0 100644 --- a/src/bluez/attrib/gattrib.c +++ b/src/bluez/attrib/gattrib.c @@ -475,8 +475,11 @@ static gboolean received_data(GIOChannel *io, GIOCondition cond, gpointer data) for (l = attrib->events; l; l = l->next) { struct event *evt = l->data; - if (match_event(evt, buf, len)) + if (match_event(evt, buf, len)) { + AUNLOCK(attrib); evt->func(buf, len, evt->user_data); + ALOCK(attrib); + } } if (!is_response(buf[0])) {