]> git.baikalelectronics.ru Git - kernel.git/commit
uas: Simplify unlink of data urbs on error
authorHans de Goede <hdegoede@redhat.com>
Sat, 13 Sep 2014 10:26:34 +0000 (12:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 04:42:10 +0000 (21:42 -0700)
commitecc6052cd03fc1b2efed80661ad5e01fc88d5c45
tree10096e48239cf0482a9a77e9c828912ea5c2fd68
parent2233353e54f04e95e6de54aa31f0ac3f54819cdb
uas: Simplify unlink of data urbs on error

There is no need for all the trickery with dropping the lock, we can
simply reference the urbs while we hold the lock to ensure the urbs don't
disappear beneath us, and do the actual unlink (+ unreference) after we've
dropped the lock.

This also fixes a race where we may loose of cmnd ownership to the scsi
midlayer without holding the lock due to the midlayer re-claiming ownership
through an abort (which will be handled by a future patch in this series).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/storage/uas.c