diff options
author | Simon Arlott <simon@fire.lp0.eu> | 2010-08-30 17:50:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:21:27 -0400 |
commit | f7dd64916bb6cfae8c96eaa3c754c30b5046586f (patch) | |
tree | 6842f3fb50c13b2707ecb8f2b271b6c09f67e2d8 /drivers/usb/core/urb.c | |
parent | 0cf7a6338808d702c256778188516a16805e6145 (diff) |
USB: output an error message when the pipe type doesn't match the endpoint type
Commit f661c6f8c67bd55e93348f160d590ff9edf08904 adds a check of the pipe type if
CONFIG_USB_DEBUG is enabled, but it doesn't output anything if this scenario
occurs.
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/urb.c')
-rw-r--r-- | drivers/usb/core/urb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 419e6b34e2f..c14fc082864 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -401,8 +401,11 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
401 | }; | 401 | }; |
402 | 402 | ||
403 | /* Check that the pipe's type matches the endpoint's type */ | 403 | /* Check that the pipe's type matches the endpoint's type */ |
404 | if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) | 404 | if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) { |
405 | dev_err(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n", | ||
406 | usb_pipetype(urb->pipe), pipetypes[xfertype]); | ||
405 | return -EPIPE; /* The most suitable error code :-) */ | 407 | return -EPIPE; /* The most suitable error code :-) */ |
408 | } | ||
406 | 409 | ||
407 | /* enforce simple/standard policy */ | 410 | /* enforce simple/standard policy */ |
408 | allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK | | 411 | allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK | |