diff options
author | Johan Hovold | 2016-10-19 08:45:07 -0500 |
---|---|---|
committer | Sasha Levin | 2016-11-25 21:57:02 -0600 |
commit | 85a2af9f690a27c064cc94e5526d18fc0887104f (patch) | |
tree | bcbb71d4683f2bae0e78a8196e6d057a78dedecf /drivers | |
parent | 0854ce492ec3b7bc0e147fdc0b7ad98c94d903fb (diff) | |
download | ti-linux-kernel-85a2af9f690a27c064cc94e5526d18fc0887104f.tar.gz ti-linux-kernel-85a2af9f690a27c064cc94e5526d18fc0887104f.tar.xz ti-linux-kernel-85a2af9f690a27c064cc94e5526d18fc0887104f.zip |
USB: serial: cp210x: fix tiocmget error handling
[ Upstream commit de24e0a108bc48062e1c7acaa97014bce32a919f ]
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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'drivers')
-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 f49e859ac5ce..6d4d8b828971 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
@@ -844,7 +844,9 @@ static int cp210x_tiocmget(struct tty_struct *tty) | |||
844 | unsigned int control; | 844 | unsigned int control; |
845 | int result; | 845 | int result; |
846 | 846 | ||
847 | cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1); | 847 | result = cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1); |
848 | if (result) | ||
849 | return result; | ||
848 | 850 | ||
849 | result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0) | 851 | result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0) |
850 | |((control & CONTROL_RTS) ? TIOCM_RTS : 0) | 852 | |((control & CONTROL_RTS) ? TIOCM_RTS : 0) |