]> git.baikalelectronics.ru Git - kernel.git/commit
serial: st-asc: Sanitize CSIZE and correct PARENB for CS7
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 19 May 2022 08:18:06 +0000 (11:18 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 May 2022 16:32:40 +0000 (18:32 +0200)
commit16c5fde603afb58b34a867e119142bb1b632b3e8
tree66190e6b63c3eae94a6c1ac6298bdf4034d07511
parente404b4e621ae63d1cde6f68fc3a09c6fbddc4091
serial: st-asc: Sanitize CSIZE and correct PARENB for CS7

Only CS7 and CS8 seem supported but CSIZE is not sanitized from CS5 or
CS6 to CS8. In addition, ASC_CTL_MODE_7BIT_PAR suggests that CS7 has
to have parity, thus add PARENB.

Incorrect CSIZE results in miscalculation of the frame bits in
tty_get_char_size() or in its predecessor where the roughly the same
code is directly within uart_update_timeout().

Fixes: b610e61f294c (serial:st-asc: Add ST ASC driver.)
Cc: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220519081808.3776-8-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/st-asc.c