diff options
-rw-r--r-- | drivers/usb/serial/pl2303.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 3368d2b0412d..a52115407ea1 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -677,6 +677,9 @@ static int pl2303_tiocmset (struct usb_serial_port *port, struct file *file, unsigned long flags; u8 control; + if (!usb_get_intfdata(port->serial->interface)) + return -ENODEV; + spin_lock_irqsave (&priv->lock, flags); if (set & TIOCM_RTS) priv->line_control |= CONTROL_RTS; @@ -702,6 +705,9 @@ static int pl2303_tiocmget (struct usb_serial_port *port, struct file *file) dbg("%s (%d)", __FUNCTION__, port->number); + if (!usb_get_intfdata(port->serial->interface)) + return -ENODEV; + spin_lock_irqsave (&priv->lock, flags); mcr = priv->line_control; status = priv->line_status; |