Diff between 32a0811685c5dd290f1152bef2dfbde3b2848446 and 2daddeada069d38c6e98e4d28a7ecd6709909c21

Changed Files

File Additions Deletions Status
src/shared/uhid.c +11 -1 modified

Full Patch

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
@@ -284,12 +284,22 @@ bool bt_uhid_unregister(struct bt_uhid *uhid, unsigned int id)
 	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;
 }