aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/devio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r--drivers/usb/core/devio.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 705c573d0257..a3fad4ec9870 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1442,14 +1442,18 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb
1442 int number_of_packets = 0; 1442 int number_of_packets = 0;
1443 unsigned int stream_id = 0; 1443 unsigned int stream_id = 0;
1444 void *buf; 1444 void *buf;
1445 1445 unsigned long mask = USBDEVFS_URB_SHORT_NOT_OK |
1446 if (uurb->flags & ~(USBDEVFS_URB_ISO_ASAP |
1447 USBDEVFS_URB_SHORT_NOT_OK |
1448 USBDEVFS_URB_BULK_CONTINUATION | 1446 USBDEVFS_URB_BULK_CONTINUATION |
1449 USBDEVFS_URB_NO_FSBR | 1447 USBDEVFS_URB_NO_FSBR |
1450 USBDEVFS_URB_ZERO_PACKET | 1448 USBDEVFS_URB_ZERO_PACKET |
1451 USBDEVFS_URB_NO_INTERRUPT)) 1449 USBDEVFS_URB_NO_INTERRUPT;
1452 return -EINVAL; 1450 /* USBDEVFS_URB_ISO_ASAP is a special case */
1451 if (uurb->type == USBDEVFS_URB_TYPE_ISO)
1452 mask |= USBDEVFS_URB_ISO_ASAP;
1453
1454 if (uurb->flags & ~mask)
1455 return -EINVAL;
1456
1453 if ((unsigned int)uurb->buffer_length >= USBFS_XFER_MAX) 1457 if ((unsigned int)uurb->buffer_length >= USBFS_XFER_MAX)
1454 return -EINVAL; 1458 return -EINVAL;
1455 if (uurb->buffer_length > 0 && !uurb->buffer) 1459 if (uurb->buffer_length > 0 && !uurb->buffer)