Skip to content

Commit

Permalink
USB: serial: cp210x: fix tiocmget error handling
Browse files Browse the repository at this point in the history
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: 39a66b8 ("[PATCH] USB: CP2101 Add support for flow control")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
  • Loading branch information
Johan Hovold committed Oct 20, 2016
1 parent ca006f7 commit de24e0a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/serial/cp210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit de24e0a

Please sign in to comment.