diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-03-21 12:36:45 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 13:48:26 -0700 |
commit | 30d9d42e9a7c205cc139dce743463b8070684df5 (patch) | |
tree | 90a06959b9d95f076272c05caefece58c983e81b /drivers/usb/serial/cyberjack.c | |
parent | c3452f5e444446fad9bb1957d22a25334798f94c (diff) | |
download | blackbird-op-linux-30d9d42e9a7c205cc139dce743463b8070684df5.tar.gz blackbird-op-linux-30d9d42e9a7c205cc139dce743463b8070684df5.zip |
USB: cyberjack: fix disconnect handling
Make sure the interrupt urb submitted in port_probe is killed in
port_remove.
The interrupt-urb completion handler references the port and may get
called after port_remove has returned and the port has been
unregistered (although this is currently prevented by usb-serial core as
we are using a non-private urb).
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/cyberjack.c')
-rw-r--r-- | drivers/usb/serial/cyberjack.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index de9253d63a48..781426230d69 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c @@ -51,7 +51,6 @@ #define CYBERJACK_PRODUCT_ID 0x0100 /* Function prototypes */ -static void cyberjack_disconnect(struct usb_serial *serial); static int cyberjack_port_probe(struct usb_serial_port *port); static int cyberjack_port_remove(struct usb_serial_port *port); static int cyberjack_open(struct tty_struct *tty, @@ -79,7 +78,6 @@ static struct usb_serial_driver cyberjack_device = { .description = "Reiner SCT Cyberjack USB card reader", .id_table = id_table, .num_ports = 1, - .disconnect = cyberjack_disconnect, .port_probe = cyberjack_port_probe, .port_remove = cyberjack_port_remove, .open = cyberjack_open, @@ -130,20 +128,14 @@ static int cyberjack_port_remove(struct usb_serial_port *port) { struct cyberjack_private *priv; + usb_kill_urb(port->interrupt_in_urb); + priv = usb_get_serial_port_data(port); kfree(priv); return 0; } -static void cyberjack_disconnect(struct usb_serial *serial) -{ - int i; - - for (i = 0; i < serial->num_ports; ++i) - usb_kill_urb(serial->port[i]->interrupt_in_urb); -} - static int cyberjack_open(struct tty_struct *tty, struct usb_serial_port *port) { |