提交 de24e0a1 编写于 作者: J Johan Hovold

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: 39a66b8d ("[PATCH] USB: CP2101 Add support for flow control")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: NJohan Hovold <johan@kernel.org>
上级 ca006f78
...@@ -1077,7 +1077,9 @@ static int cp210x_tiocmget(struct tty_struct *tty) ...@@ -1077,7 +1077,9 @@ static int cp210x_tiocmget(struct tty_struct *tty)
u8 control; u8 control;
int result; 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) result = ((control & CONTROL_DTR) ? TIOCM_DTR : 0)
|((control & CONTROL_RTS) ? TIOCM_RTS : 0) |((control & CONTROL_RTS) ? TIOCM_RTS : 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册