]> err.no Git - linux-2.6/commitdiff
USB: ftdi_sio: Note missing locking
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Wed, 20 Feb 2008 20:49:53 +0000 (20:49 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Apr 2008 04:16:38 +0000 (21:16 -0700)
The ftdi_sio driver has no internal locking on the dtr/rts state. Flag
that up for someone to fix.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/ftdi_sio.c

index 3abb3c863647832a31937fb3363f415f4a344ed9..4643212eb959b98448877134da389e6836ae928d 100644 (file)
@@ -533,9 +533,8 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, unsigned
        }
 
        buf = kmalloc(1, GFP_NOIO);
-       if (!buf) {
+       if (!buf)
                return -ENOMEM;
-       }
 
        clear &= ~set;  /* 'set' takes precedence over 'clear' */
        urb_value = 0;
@@ -568,6 +567,7 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, unsigned
                                (clear & TIOCM_DTR) ? "LOW" : "unchanged",
                                (set & TIOCM_RTS) ? "HIGH" :
                                (clear & TIOCM_RTS) ? "LOW" : "unchanged");
+               /* FIXME: locking on last_dtr_rts */
                priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set;
        }
        return rv;