aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_baudrate.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2018-07-15 15:39:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-16 11:58:15 +0200
commitfada18c48d774b9e837928ecdce6a5d5fdd11ee7 (patch)
tree8aaf2a591e97164179394b13f5fce62e6fec84f3 /drivers/tty/tty_baudrate.c
parenttty: serial: qcom_geni_serial: Add support for flow control (diff)
downloadlinux-dev-fada18c48d774b9e837928ecdce6a5d5fdd11ee7.tar.xz
linux-dev-fada18c48d774b9e837928ecdce6a5d5fdd11ee7.zip
tty: fix termios input-speed encoding
Make sure to clear the CIBAUD bits before OR-ing the new mask when encoding the termios input baud rate. This could otherwise lead to an incorrect input rate being reported back and incidentally set on subsequent termios updates. Fixes: edc6afc54968 ("[PATCH] tty: switch to ktermios and new framework") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_baudrate.c')
-rw-r--r--drivers/tty/tty_baudrate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c
index 6ff8cdfc9d2a..a7a438f54e69 100644
--- a/drivers/tty/tty_baudrate.c
+++ b/drivers/tty/tty_baudrate.c
@@ -169,6 +169,9 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
ibinput = 1; /* An input speed was specified */
#endif
termios->c_cflag &= ~CBAUD;
+#ifdef IBSHIFT
+ termios->c_cflag &= ~(CBAUD << IBSHIFT);
+#endif
/*
* Our goal is to find a close match to the standard baud rate