Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7d77722 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

USB: serial: keyspan_pda: fix tx-unthrottle use-after-free



commit 49fbb8e37a961396a5b6c82937c70df91de45e9d upstream.

The driver's transmit-unthrottle work was never flushed on disconnect,
something which could lead to the driver port data being freed while the
unthrottle work is still scheduled.

Fix this by cancelling the unthrottle work when shutting down the port.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Acked-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 41bb69bb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -647,8 +647,12 @@ static int keyspan_pda_open(struct tty_struct *tty,
}
static void keyspan_pda_close(struct usb_serial_port *port)
{
	struct keyspan_pda_private *priv = usb_get_serial_port_data(port);

	usb_kill_urb(port->write_urb);
	usb_kill_urb(port->interrupt_in_urb);

	cancel_work_sync(&priv->unthrottle_work);
}