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 --- 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