Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7dd6491 authored by Simon Arlott's avatar Simon Arlott Committed by Greg Kroah-Hartman
Browse files

USB: output an error message when the pipe type doesn't match the endpoint type



Commit f661c6f8 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: default avatarSimon Arlott <simon@fire.lp0.eu>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0cf7a633
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -401,8 +401,11 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
	};

	/* Check that the pipe's type matches the endpoint's type */
	if (usb_pipetype(urb->pipe) != pipetypes[xfertype])
	if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) {
		dev_err(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n",
			usb_pipetype(urb->pipe), pipetypes[xfertype]);
		return -EPIPE;		/* The most suitable error code :-) */
	}

	/* enforce simple/standard policy */
	allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK |