diff --git a/src/shared/att.c b/src/shared/att.c
index 55d633b..7671d67 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
bt_att_ref(att);
- for (found = false, entry = queue_get_entries(att->notify_list);
- !queue_isempty(att->notify_list) && entry;) {
+ found = false;
+ entry = queue_get_entries(att->notify_list);
+
+ while (entry) {
struct att_notify *notify = entry->data;
entry = entry->next;
if (notify->callback)
notify->callback(opcode, pdu, pdu_len,
notify->user_data);
+
+ /* callback could remove all entries from notify list */
+ if (queue_isempty(att->notify_list))
+ break;
}
/*