Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Simon Arlott and committed by
Greg Kroah-Hartman
f7dd6491 0cf7a633

+4 -1
+4 -1
drivers/usb/core/urb.c
··· 401 401 }; 402 402 403 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 407 return -EPIPE; /* The most suitable error code :-) */ 408 + } 406 409 407 410 /* enforce simple/standard policy */ 408 411 allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK |