diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2021-12-20 10:51:20 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-12-29 11:50:29 +0100 |
commit | 8684d7eaf3354153139efc417504ccf70ef8698c (patch) | |
tree | 66a586954eea56e3a1bd1d679e9a1abcd88d60dc | |
parent | f48b93b3c8cae1effa78580e963407665d3c74a8 (diff) | |
download | linux-stable-8684d7eaf3354153139efc417504ccf70ef8698c.tar.gz linux-stable-8684d7eaf3354153139efc417504ccf70ef8698c.tar.bz2 linux-stable-8684d7eaf3354153139efc417504ccf70ef8698c.zip |
HID: holtek: fix mouse probing
commit 93a2207c254ca102ebbdae47b00f19bbfbfa7ecd upstream.
An overlook from the previous commit: we don't even parse or start the
device, meaning that the device is not presented to user space.
Fixes: 93020953d0fa ("HID: check for valid USB device for many HID drivers")
Cc: stable@vger.kernel.org
Link: https://bugs.archlinux.org/task/73048
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215341
Link: https://lore.kernel.org/r/e4efbf13-bd8d-0370-629b-6c80c0044b15@leemhuis.info/
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/hid/hid-holtek-mouse.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/hid/hid-holtek-mouse.c b/drivers/hid/hid-holtek-mouse.c index 27c08ddab0e1..96db7e96fcea 100644 --- a/drivers/hid/hid-holtek-mouse.c +++ b/drivers/hid/hid-holtek-mouse.c @@ -68,8 +68,23 @@ static __u8 *holtek_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, static int holtek_mouse_probe(struct hid_device *hdev, const struct hid_device_id *id) { + int ret; + if (!hid_is_usb(hdev)) return -EINVAL; + + ret = hid_parse(hdev); + if (ret) { + hid_err(hdev, "hid parse failed: %d\n", ret); + return ret; + } + + ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); + if (ret) { + hid_err(hdev, "hw start failed: %d\n", ret); + return ret; + } + return 0; } |