aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-10-29 05:56:23 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-30 16:19:30 -0400
commit2c2ee545071c10873b057b04a19d3d2aed04b9cf (patch)
tree83bdacb42f3bd36c10c2ab0049405a7d247a68a5 /drivers/usb/serial
parentfef0b828a3c7a7123aedb4b1d8415369f75e0a58 (diff)
USB: ftdi_sio: fix tiocmget and tiocmset return values
Make sure we do not return USB-internal error codes to userspace. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/ftdi_sio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 2ad5e7c7f226..987cc2cafa3b 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1091,6 +1091,7 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set,
1091 __func__, 1091 __func__,
1092 (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1092 (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged",
1093 (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 1093 (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged");
1094 rv = usb_translate_errors(rv);
1094 } else { 1095 } else {
1095 dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__, 1096 dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__,
1096 (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1097 (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged",
@@ -2369,8 +2370,10 @@ static int ftdi_tiocmget(struct tty_struct *tty)
2369 FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 2370 FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
2370 0, priv->interface, 2371 0, priv->interface,
2371 buf, len, WDR_TIMEOUT); 2372 buf, len, WDR_TIMEOUT);
2372 if (ret < 0) 2373 if (ret < 0) {
2374 ret = usb_translate_errors(ret);
2373 goto out; 2375 goto out;
2376 }
2374 2377
2375 ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | 2378 ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) |
2376 (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | 2379 (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) |