[25/82] USB: mct_u232: fix broken close

From: Greg KH
Date: Fri Nov 19 2010 - 16:58:43 EST


2.6.35-stable review patch. If anyone has any objections, please let us know.

------------------

From: Johan Hovold <jhovold@xxxxxxxxx>

commit 92ca0dc5ee022e4c0e488177e1d8865a0778c6c2 upstream.

Fix regression introduced by commit
f26788da3b342099d2b02d99ba1cb7f154d6ef7b (USB: serial: refactor generic
close) which broke driver close().

This driver uses non-standard semantics for the read urb which makes the
generic close function fail to kill it (the read urb is actually an
interrupt urb and therefore bulk_in size is zero).

Reported-by: Eric Shattow "Eprecocious" <lucent@xxxxxxxxx>
Tested-by: Eric Shattow "Eprecocious" <lucent@xxxxxxxxx>
Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/usb/serial/mct_u232.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -549,9 +549,12 @@ static void mct_u232_close(struct usb_se
{
dbg("%s port %d", __func__, port->number);

- usb_serial_generic_close(port);
- if (port->serial->dev)
+ if (port->serial->dev) {
+ /* shutdown our urbs */
+ usb_kill_urb(port->write_urb);
+ usb_kill_urb(port->read_urb);
usb_kill_urb(port->interrupt_in_urb);
+ }
} /* mct_u232_close */




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/