]> Git Repo - linux.git/commitdiff
Input: iforce - add sanity checks
authorOliver Neukum <[email protected]>
Tue, 6 Aug 2019 16:05:55 +0000 (09:05 -0700)
committerDmitry Torokhov <[email protected]>
Tue, 6 Aug 2019 16:10:57 +0000 (09:10 -0700)
The endpoint type should also be checked before a device
is accepted.

Reported-by: [email protected]
Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
drivers/input/joystick/iforce/iforce-usb.c

index 29abfeeef9a5f58e9e3840f42ee7a10ab78df210..6c554c11a7ac3f35a33b318f7f6bef589a8c6b81 100644 (file)
@@ -201,7 +201,12 @@ static int iforce_usb_probe(struct usb_interface *intf,
                return -ENODEV;
 
        epirq = &interface->endpoint[0].desc;
+       if (!usb_endpoint_is_int_in(epirq))
+               return -ENODEV;
+
        epout = &interface->endpoint[1].desc;
+       if (!usb_endpoint_is_int_out(epout))
+               return -ENODEV;
 
        iforce_usb = kzalloc(sizeof(*iforce_usb), GFP_KERNEL);
        if (!iforce_usb)
This page took 0.059302 seconds and 4 git commands to generate.