diff options
author | Johan Hovold <johan@kernel.org> | 2016-10-19 16:45:07 +0300 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2016-10-20 12:15:20 +0300 |
commit | de24e0a108bc48062e1c7acaa97014bce32a919f (patch) | |
tree | 209a3d0ca8d086b39060cd38890acdd16c516e33 /drivers/usb | |
parent | ca006f785fbfd7a5c901900bd3fe2b26e946a1ee (diff) | |
download | linux-de24e0a108bc48062e1c7acaa97014bce32a919f.tar.xz |
USB: serial: cp210x: fix tiocmget error handling
The current tiocmget implementation would fail to report errors up the
stack and instead leaked a few bits from the stack as a mask of
modem-status flags.
Fixes: 39a66b8d22a3 ("[PATCH] USB: CP2101 Add support for flow control")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/cp210x.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 54a4de0efdba..f61477bed3a8 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c @@ -1077,7 +1077,9 @@ static int cp210x_tiocmget(struct tty_struct *tty) u8 control; int result; - cp210x_read_u8_reg(port, CP210X_GET_MDMSTS, &control); + result = cp210x_read_u8_reg(port, CP210X_GET_MDMSTS, &control); + if (result) + return result; result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0) |((control & CONTROL_RTS) ? TIOCM_RTS : 0) |