mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
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]>
This commit is contained in:
1 parent
37ad2e3434
commit
849f5ae3a5
1 file changed
+5
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user