Skip to content

Commit 849f5ae

Browse files
oneukumdtor
authored andcommitted
Input: iforce - add sanity checks
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]>
1 parent 37ad2e3 commit 849f5ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/input/joystick/iforce/iforce-usb.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,12 @@ static int iforce_usb_probe(struct usb_interface *intf,
201201
return -ENODEV;
202202

203203
epirq = &interface->endpoint[0].desc;
204+
if (!usb_endpoint_is_int_in(epirq))
205+
return -ENODEV;
206+
204207
epout = &interface->endpoint[1].desc;
208+
if (!usb_endpoint_is_int_out(epout))
209+
return -ENODEV;
205210

206211
iforce_usb = kzalloc(sizeof(*iforce_usb), GFP_KERNEL);
207212
if (!iforce_usb)

0 commit comments

Comments
 (0)