diff --git a/src/shared/uhid.c b/src/shared/uhid.c
index 98d6198..ed21e13 100644
--- a/src/shared/uhid.c
+++ b/src/shared/uhid.c
return true;
}
+static bool match_not_id(const void *a, const void *b)
+{
+ const struct uhid_notify *notify = a;
+ unsigned int id = PTR_TO_UINT(b);
+
+ return notify->id != id;
+}
+
bool bt_uhid_unregister_all(struct bt_uhid *uhid)
{
if (!uhid)
return false;
- queue_remove_all(uhid->notify_list, NULL, NULL, free);
+ queue_remove_all(uhid->notify_list, match_not_id,
+ UINT_TO_PTR(uhid->start_id), free);
+
return true;
}