summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Clinckx <clinckx.louis@gmail.com>2026-05-15 14:57:39 +0000
committerBenjamin Tissoires <bentiss@kernel.org>2026-05-21 17:12:54 +0200
commit2ee7e632405b022319f42c01635eb6fbbd86414a (patch)
treeeacff146a3e65a7d17c2d9d2d86fa75dc1fc6672
parentc7ee0b73c8c4dfb7eafa49aaef5247890862a948 (diff)
HID: lenovo-go: reject non-USB transports in probe
These drivers only match HID_USB_DEVICE() entries and assume the underlying bus is USB. Make that explicit at probe by rejecting any non-USB hdev, following the pattern used by other HID drivers. Signed-off-by: Louis Clinckx <clinckx.louis@gmail.com> Reviewed-by: Derek J. Clark <derekjoh.clark@gmail.com> Tested-by: Derek J. Clark <derekjohn.clark@gmail.com> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
-rw-r--r--drivers/hid/hid-lenovo-go-s.c3
-rw-r--r--drivers/hid/hid-lenovo-go.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-lenovo-go-s.c b/drivers/hid/hid-lenovo-go-s.c
index ff1782a75191..0444d84498bd 100644
--- a/drivers/hid/hid-lenovo-go-s.c
+++ b/drivers/hid/hid-lenovo-go-s.c
@@ -1461,6 +1461,9 @@ static int hid_gos_probe(struct hid_device *hdev,
{
int ret, ep;
+ if (!hid_is_usb(hdev))
+ return -EINVAL;
+
ret = hid_parse(hdev);
if (ret) {
hid_err(hdev, "Parse failed\n");
diff --git a/drivers/hid/hid-lenovo-go.c b/drivers/hid/hid-lenovo-go.c
index d4d26c783356..3fa1fe83f7e5 100644
--- a/drivers/hid/hid-lenovo-go.c
+++ b/drivers/hid/hid-lenovo-go.c
@@ -2419,6 +2419,9 @@ static int hid_go_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
int ret, ep;
+ if (!hid_is_usb(hdev))
+ return -EINVAL;
+
hdev->quirks |= HID_QUIRK_INPUT_PER_APP | HID_QUIRK_MULTI_INPUT;
ret = hid_parse(hdev);