aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index a84216464ca0..bd7581b3a48a 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -21,6 +21,7 @@
21#include <linux/errno.h> 21#include <linux/errno.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/smp_lock.h>
24#include <linux/tty.h> 25#include <linux/tty.h>
25#include <linux/tty_driver.h> 26#include <linux/tty_driver.h>
26#include <linux/tty_flip.h> 27#include <linux/tty_flip.h>
@@ -220,7 +221,8 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
220 tty->driver_data = port; 221 tty->driver_data = port;
221 tty_port_tty_set(&port->port, tty); 222 tty_port_tty_set(&port->port, tty);
222 223
223 if (port->port.count == 1) { 224 /* If the console is attached, the device is already open */
225 if (port->port.count == 1 && !port->console) {
224 226
225 /* lock this module before we call it 227 /* lock this module before we call it
226 * this may fail, which means we must bail out, 228 * this may fail, which means we must bail out,