diff options
Diffstat (limited to 'drivers/usb/core/urb.c')
-rw-r--r-- | drivers/usb/core/urb.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index e7cae1334693..e2bd153cbd89 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -387,6 +387,13 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
387 | { | 387 | { |
388 | unsigned int orig_flags = urb->transfer_flags; | 388 | unsigned int orig_flags = urb->transfer_flags; |
389 | unsigned int allowed; | 389 | unsigned int allowed; |
390 | static int pipetypes[4] = { | ||
391 | PIPE_CONTROL, PIPE_ISOCHRONOUS, PIPE_BULK, PIPE_INTERRUPT | ||
392 | }; | ||
393 | |||
394 | /* Check that the pipe's type matches the endpoint's type */ | ||
395 | if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) | ||
396 | return -EPIPE; /* The most suitable error code :-) */ | ||
390 | 397 | ||
391 | /* enforce simple/standard policy */ | 398 | /* enforce simple/standard policy */ |
392 | allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP | | 399 | allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP | |