Skip to content

Commit

Permalink
Input: iforce - add sanity checks
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
oneukum authored and dtor committed Aug 6, 2019
1 parent 37ad2e3 commit 849f5ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/input/joystick/iforce/iforce-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 849f5ae

Please sign in to comment.