From: Savin Zlobec Date: Fri, 15 Feb 2008 12:42:01 +0000 (+0100) Subject: USB: gadget: Hangup tty on g_serial disconnect X-Git-Tag: v2.6.26-rc1~1061^2~95 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=4208978ec4f0d6001facf95be9defccf1a0bf313;p=~emulex%2Finfiniband.git USB: gadget: Hangup tty on g_serial disconnect On USB cable disconnect g_serial doesn't hangup the port tty, which results in an endless read on the tty device. With the following patch the read and select behave correctly when the cable is unplugged. Tested on at91rm9200 Signed-off-by: Savin Zlobec Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index f5c3896b1d9..433b3f44f42 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c @@ -2163,8 +2163,7 @@ static void gs_free_ports(struct gs_dev *dev) port->port_dev = NULL; wake_up_interruptible(&port->port_write_wait); if (port->port_tty) { - wake_up_interruptible(&port->port_tty->read_wait); - wake_up_interruptible(&port->port_tty->write_wait); + tty_hangup(port->port_tty); } spin_unlock_irqrestore(&port->port_lock, flags); } else {