aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/whiteheat.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/whiteheat.c')
-rw-r--r--drivers/usb/serial/whiteheat.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index f5033d482eee..38726ef3132b 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -658,11 +658,14 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp)
658 struct list_head *tmp2; 658 struct list_head *tmp2;
659 659
660 dbg("%s - port %d", __FUNCTION__, port->number); 660 dbg("%s - port %d", __FUNCTION__, port->number);
661 661
662 mutex_lock(&port->serial->disc_mutex);
662 /* filp is NULL when called from usb_serial_disconnect */ 663 /* filp is NULL when called from usb_serial_disconnect */
663 if (filp && (tty_hung_up_p(filp))) { 664 if ((filp && (tty_hung_up_p(filp))) || port->serial->disconnected) {
665 mutex_unlock(&port->serial->disc_mutex);
664 return; 666 return;
665 } 667 }
668 mutex_unlock(&port->serial->disc_mutex);
666 669
667 port->tty->closing = 1; 670 port->tty->closing = 1;
668 671