aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2016-10-19 15:45:07 +0200
committerSasha Levin <alexander.levin@verizon.com>2016-11-23 22:56:56 -0500
commit1f601388d5c150f0cef255bdb1a9296bdab9e157 (patch)
tree55e5b6a95f36632005acb3355586349b851852c0
parentd95841d1158bf0234198a4491471f5f3ab3de7fa (diff)
downloadlinux-linaro-stable-1f601388d5c150f0cef255bdb1a9296bdab9e157.tar.gz
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>
-rw-r--r--drivers/usb/serial/cp210x.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 685a90168d8e..faab1f8ea370 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -845,7 +845,9 @@ static int cp210x_tiocmget(struct tty_struct *tty)
unsigned int control;
int result;
- cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
+ result = cp210x_get_config(port, CP210X_GET_MDMSTS, &control, 1);
+ if (result)
+ return result;
result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
|((control & CONTROL_RTS) ? TIOCM_RTS : 0)