From 37468c6112a1ddb8f53f653b1abbb8ae84a8baff Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 2 Jan 2009 13:47:06 +0000 Subject: [PATCH] --- yaml --- r: 125064 b: refs/heads/master c: eff6937a46e096eb35c16a391617b7a5e098a30c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/serial/usb-serial.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 4c88679f59ae..76731253176b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 39aced68d664291db3324d0fcf0985ab5626aac2 +refs/heads/master: eff6937a46e096eb35c16a391617b7a5e098a30c diff --git a/trunk/drivers/usb/serial/usb-serial.c b/trunk/drivers/usb/serial/usb-serial.c index aafa684a900f..8d5189096470 100644 --- a/trunk/drivers/usb/serial/usb-serial.c +++ b/trunk/drivers/usb/serial/usb-serial.c @@ -339,6 +339,10 @@ static int serial_chars_in_buffer(struct tty_struct *tty) dbg("%s = port %d", __func__, port->number); WARN_ON(!port->port.count); + /* if the device was unplugged then any remaining characters + fell out of the connector ;) */ + if (port->serial->disconnected) + return 0; /* pass on to the driver specific version of this function */ return port->serial->type->chars_in_buffer(tty); }