linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: winwing: remove unpaired hid_hw_close()
@ 2026-09-13 14:39 Guangshuo Li
  2026-09-13 14:50 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Guangshuo Li @ 2026-09-13 14:39 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, Ivan Gorinov, linux-input,
	linux-kernel
  Cc: Guangshuo Li, stable

winwing_probe() starts the HID hardware with hid_hw_start(), but never
calls hid_hw_open(). Despite this, winwing_remove() calls
hid_hw_close() before hid_hw_stop().

hid_hw_close() decrements hdev->ll_open_count. Calling it without a
matching hid_hw_open() can therefore underflow the count when there are
no open users, or incorrectly consume an open reference owned by
another HID user. A subsequent legitimate close may then underflow the
count instead.

hid_hw_stop() disconnects the HID users, allowing them to release their
own open references, and is the proper counterpart to hid_hw_start().
Remove the unpaired hid_hw_close() call.

This issue was found by manual code inspection.

Fixes: 42d020b54edc ("HID: winwing: Enable rumble effects")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
 drivers/hid/hid-winwing.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/hid/hid-winwing.c b/drivers/hid/hid-winwing.c
index 9cd25a77999e..e18728f215ae 100644
--- a/drivers/hid/hid-winwing.c
+++ b/drivers/hid/hid-winwing.c
@@ -388,7 +388,6 @@ static void winwing_remove(struct hid_device *hdev)
 	if (data)
 		cancel_work_sync(&data->rumble_work);
 
-	hid_hw_close(hdev);
 	hid_hw_stop(hdev);
 }
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-13 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-13 14:39 [PATCH] HID: winwing: remove unpaired hid_hw_close() Guangshuo Li
2026-09-13 14:50 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).