diff mbox series

[BlueZ,v2] shared/uhid: Fix unregistering UHID_START on bt_uhid_unregister_all

Message ID 20240828202949.924451-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v2] shared/uhid: Fix unregistering UHID_START on bt_uhid_unregister_all | expand

Commit Message

Luiz Augusto von Dentz Aug. 28, 2024, 8:29 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

uhid->start_id shall not be unregistered in case of
bt_uhid_unregister_all as that is considerer a internal notification
not under controller of the users.
---
 src/shared/uhid.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Aug. 28, 2024, 10:03 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=884452

---Test result---

Test Summary:
CheckPatch                    PASS      0.46 seconds
GitLint                       PASS      0.31 seconds
BuildEll                      PASS      24.52 seconds
BluezMake                     PASS      1696.14 seconds
MakeCheck                     PASS      13.96 seconds
MakeDistcheck                 PASS      178.71 seconds
CheckValgrind                 PASS      252.44 seconds
CheckSmatch                   PASS      356.46 seconds
bluezmakeextell               PASS      120.07 seconds
IncrementalBuild              PASS      1455.33 seconds
ScanBuild                     PASS      1009.01 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org Aug. 29, 2024, 3:50 p.m. UTC | #2
Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 28 Aug 2024 16:29:49 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> uhid->start_id shall not be unregistered in case of
> bt_uhid_unregister_all as that is considerer a internal notification
> not under controller of the users.
> ---
>  src/shared/uhid.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,v2] shared/uhid: Fix unregistering UHID_START on bt_uhid_unregister_all
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2daddeada069

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/shared/uhid.c b/src/shared/uhid.c
index 98d6198c7d0a..ed21e1399ba7 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;
 }