소스 검색

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 <savin@epiko.si>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Savin Zlobec 17 년 전
부모
커밋
4208978ec4
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      drivers/usb/gadget/serial.c

+ 1 - 2
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 {