summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2022-05-19 11:18:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-19 19:32:40 +0300
commitef44c6c1e86fa89f20d27713d7268d7c7689af5c (patch)
treef3cf7a0c93403b6f6a9489a9d8f424eabf0c3d25 /drivers/char
parent1deeda8d2877c18bc2b9eeee10dd6d2628852848 (diff)
downloadlinux-ef44c6c1e86fa89f20d27713d7268d7c7689af5c.tar.xz
pcmcia: synclink_cs: Don't allow CS5-6
Only CS7 and CS8 seem supported but CSIZE was not sanitized in termios c_cflag. The driver sets 7 bits whenever data_bits is not 8 so default to CS7 when CSIZE is not CS8. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20220519081808.3776-10-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/pcmcia/synclink_cs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index c20f2cb784e8..0daf1bc95360 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -1418,7 +1418,11 @@ static void mgslpc_change_params(MGSLPC_INFO *info, struct tty_struct *tty)
info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
/* byte size and parity */
-
+ if ((cflag & CSIZE) != CS8) {
+ cflag &= ~CSIZE;
+ cflag |= CS7;
+ tty->termios.c_cflag = cflag;
+ }
info->params.data_bits = tty_get_char_size(cflag);
if (cflag & CSTOPB)