path: root/Documentation/usb
diff options
authorAlan Stern <stern@rowland.harvard.edu>2012-03-22 11:00:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-06 13:54:00 -0700
commitbcf398537630bf20b4dbe59ba855b69f404c93cf (patch)
tree0f44291e1cb72c146ed7187e6b476cedb6ad7d74 /Documentation/usb
parentc825bab0cef8b90bab8b63eb5686b8c8eb22e798 (diff)
USB: don't clear urb->dev in scatter-gather library
This patch (as1517b) fixes an error in the USB scatter-gather library. The library code uses urb->dev to determine whether or nor an URB is currently active; the completion handler sets urb->dev to NULL. However the core unlinking routines need to use urb->dev. Since unlinking always racing with completion, the completion handler must not clear urb->dev -- it can lead to invalid memory accesses when a transfer has to be cancelled. This patch fixes the problem by getting rid of the lines that clear urb->dev after urb has been submitted. As a result we may end up trying to unlink an URB that failed in submission or that has already completed, so an extra check is added after each unlink to avoid printing an error message when this happens. The checks are updated in both sg_complete() and sg_cancel(), and the second is updated to match the first (currently it prints out unnecessary warning messages if a device is unplugged while a transfer is in progress). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-and-tested-by: Illia Zaitsev <I.Zaitsev@adbglobal.com> CC: Ming Lei <tom.leiming@gmail.com> CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/usb')
0 files changed, 0 insertions, 0 deletions