Skip to content

Commit

Permalink
USB: mct_u232: fix broken close
Browse files Browse the repository at this point in the history
Make sure generic close is called at close.

The driver relies on the generic write implementation but did not call
generic close.

Note that the call to kill the read urb is not redundant, as mct_u232
uses an interrupt urb from the second port as the read urb and that
generic close therefore fails to kill it.

Compile-only tested.

Cc: <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Oct 25, 2012
1 parent a8f2ae7 commit 5260e45
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/usb/serial/mct_u232.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,14 @@ static void mct_u232_dtr_rts(struct usb_serial_port *port, int on)

static void mct_u232_close(struct usb_serial_port *port)
{
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);
}
/*
* Must kill the read urb as it is actually an interrupt urb, which
* generic close thus fails to kill.
*/
usb_kill_urb(port->read_urb);
usb_kill_urb(port->interrupt_in_urb);

usb_serial_generic_close(port);
} /* mct_u232_close */


Expand Down

0 comments on commit 5260e45

Please sign in to comment.