]> git.baikalelectronics.ru Git - kernel.git/commit
USB: check the endpoint type against the pipe type
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 11 Dec 2009 21:20:20 +0000 (16:20 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 2 Mar 2010 22:53:07 +0000 (14:53 -0800)
commit2a101213a8c8f1783b948b0af9e5af1443dec92f
tree9b5abdda44f9bfb0b6a6dcb51217701a67ed40a0
parente021d36eba47f23e138936f8d94a0d3c22cf41f8
USB: check the endpoint type against the pipe type

This patch (as1316) adds some error checking to usb_submit_urb().
It's conditional on CONFIG_USB_DEBUG, so it won't affect normal users.
The new check makes sure that the actual type of the endpoint
described by urb->pipe agrees with the type encoded in the pipe value.

The USB error code documentation is updated to include the code
returned by the new check, and the usbfs SUBMITURB handler is updated
to use the correct pipe type when legacy user code tries to submit a
bulk transfer to an interrupt endpoint.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Documentation/usb/error-codes.txt
drivers/usb/core/devio.c
drivers/usb/core/urb.c