tree 83b425282fb306a2b96520431867430233955385
parent 8835f6657316162a8937d3f26ccd8f5886ba3845
author Flavio Leitner <[EMAIL PROTECTED]> Tue, 19 Apr 2005 07:39:31 -0700
committer Greg K-H <[EMAIL PROTECTED]> Tue, 19 Apr 2005 07:39:31 -0700

[PATCH] pl2303 - unplug device.

It's possible to unplug usb device and do tiocmset() and tiocmget() without
valid interface in pl2303 module.

The patch below check this and return -ENODEV if interface was removed.

From: Flavio Leitner <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

diff -purN linux-05-04-11/drivers/usb/serial/pl2303.c 
linux-05-04-11.usb/drivers/usb/serial/pl2303.c

 usb/serial/pl2303.c |    6 ++++++
 1 files changed, 6 insertions(+)

Index: drivers/usb/serial/pl2303.c
===================================================================
--- 7f6f1860d05a4d6afa4284c385ecb0a402b32f48/drivers/usb/serial/pl2303.c  
(mode:100644 sha1:3368d2b0412d2ef74cdc4b9784b4f877f741522d)
+++ 83b425282fb306a2b96520431867430233955385/drivers/usb/serial/pl2303.c  
(mode:100644 sha1:a52115407ea13f15724cceb0e4a4ddf4727bf5ae)
@@ -677,6 +677,9 @@
        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 @@
 
        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;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to