From: Alan Cox Date: Wed, 20 Feb 2008 20:49:53 +0000 (+0000) Subject: USB: ftdi_sio: Note missing locking X-Git-Tag: MMI-PSA29.97-13-9~35531^2~83 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9b0f2582d57d4c9081307c86e11afc9169de7d3e;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git USB: ftdi_sio: Note missing locking 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 3abb3c863647..4643212eb959 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -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;