Skip to content

Commit 59579a8

Browse files
author
Jiri Kosina
committed
HID: u2fzero: fail probe if not using USB transport
u2fzero driver is USB-only. Therefore we have to give up in ->probe() callback in case we're called with non-USB transport driver bound, otherwise the kernel will crash trying to use USBHID API on a non-USB transport. Fixes: 42337b9("HID: add driver for U2F Zero built-in LED and RNG") Reported-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent e252e0e commit 59579a8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/hid/hid-u2fzero.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ static int u2fzero_probe(struct hid_device *hdev,
286286
unsigned int minor;
287287
int ret;
288288

289+
if (!hid_is_using_ll_driver(hdev, &usb_hid_driver))
290+
return -EINVAL;
291+
289292
dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);
290293
if (dev == NULL)
291294
return -ENOMEM;

0 commit comments

Comments
 (0)