]> git.baikalelectronics.ru Git - kernel.git/commit
USB: usbfs: Always unlink URBs in reverse order
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 17 Jan 2020 15:47:13 +0000 (10:47 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 16:57:04 +0000 (17:57 +0100)
commitda158ba4d6431a669d6efbf86580cbaf151ed7ff
tree68c314a1d2f3f1c9f1308ddc53f1fd4feb978bd9
parentb873d45bc987a86047206b966b9b4d52f471f2fb
USB: usbfs: Always unlink URBs in reverse order

When the kernel unlinks a bunch of URBs for a single endpoint, it
should always unlink them in reverse order.  This eliminates any
possibility that some URB x will be unlinked before it can execute but
the following URB x+1 will execute before it can be unlinked.  Such an
event would be bad, for obvious reasons.

Chris Dickens pointed out that usbfs doesn't behave this way when it
is unbound from an interface.  All pending URBs are cancelled, but in
the order of submission.  This patch changes the behavior to make the
unlinks occur in reverse order.  It similarly changes the behavior
when usbfs cancels the continuation URBs for a BULK endpoint.

Suggested-by: Chris Dickens <christopher.a.dickens@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/Pine.LNX.4.44L0.2001171045380.1571-100000@iolanthe.rowland.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/devio.c