]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: usb_wwan: fix urb leak at shutdown
authorJohan Hovold <jhovold@gmail.com>
Mon, 26 May 2014 17:23:16 +0000 (19:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:11:57 +0000 (20:11 -0700)
commit582e7e5f9cc0d35e56bfb5e79f242d9e5dd317ba
treeb76c7a1296cca697f5ab912049f36a874ad33929
parent5a77e53bb1cb996391ab1feb898b6ffb0657f96f
USB: usb_wwan: fix urb leak at shutdown

commit 79eed03e77d481b55d85d1cfe5a1636a0d3897fd upstream.

The delayed-write queue was never emptied at shutdown (close), something
which could lead to leaked urbs if the port is closed before being
runtime resumed due to a write.

When this happens the output buffer would not drain on close
(closing_wait timeout), and after consecutive opens, writes could be
corrupted with previously buffered data, transfered with reduced
throughput or completely blocked.

Note that unbusy_queued_urb() was simply moved out of CONFIG_PM.

Fixes: 383cedc3bb43 ("USB: serial: full autosuspend support for the
option driver")

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/usb_wwan.c