]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: serial: fix stalled writes
authorJohan Hovold <jhovold@gmail.com>
Wed, 4 Aug 2010 13:45:57 +0000 (15:45 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Aug 2010 20:31:01 +0000 (13:31 -0700)
commit4a561f2ed8e6e5c428bae18af3f48045211add08
treef94ecea674295ce62a6c0908d6724c469004a9c9
parent8762dc2878fcdab3a3d71502c42e5923c79e8086
USB: serial: fix stalled writes

commit b58af4066d240b18b43f202e07b9ec7461d90b17 upstream.

As David VomLehn points out, it was possible to receive an interrupt
before clearing the free-urb flag which could lead to the urb being
incorrectly marked as busy.

For the same reason, move tx_bytes accounting so that it will never be
negative.

Note that the free-flags set and clear operations do not need any
additional locking as they are manipulated while USB_SERIAL_WRITE_BUSY
is set.

Reported-by: David VomLehn <dvomlehn@cisco.com>
Tested-by: David VomLehn <dvomlehn@cisco.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/generic.c