mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
USB: serial: cp210x: fix tiocmget error handling
commitde24e0a108upstream. 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:39a66b8d22("[PATCH] USB: CP2101 Add support for flow control") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
00877d1393
commit
f49f9df84e
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user