[PATCH BlueZ v1 2/2] shared/uhid: Fix not cleanup input queue on destroy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

The input queue shall be cleanup on bt_uhid_destroy since that shall not
be carried to the next session even if the input node is not destroyed.
---
 src/shared/uhid.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/shared/uhid.c b/src/shared/uhid.c
index b0a436d7862b..37574f75888d 100644
--- a/src/shared/uhid.c
+++ b/src/shared/uhid.c
@@ -504,6 +504,10 @@ int bt_uhid_destroy(struct bt_uhid *uhid, bool force)
 	if (!uhid)
 		return -EINVAL;
 
+	/* Cleanup input queue */
+	queue_destroy(uhid->input, free);
+	uhid->input = NULL;
+
 	/* Force destroy for non-keyboard devices - keyboards are not destroyed
 	 * on disconnect since they can glitch on reconnection losing
 	 * keypresses.
-- 
2.46.0





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux