]> Git Repo - J-linux.git/commitdiff
pcmcia: synclink_cs: Don't allow CS5-6
authorIlpo Järvinen <[email protected]>
Thu, 19 May 2022 08:18:08 +0000 (11:18 +0300)
committerGreg Kroah-Hartman <[email protected]>
Thu, 19 May 2022 16:32:40 +0000 (18:32 +0200)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/char/pcmcia/synclink_cs.c

index c20f2cb784e86659c09ee48d0c73e38c63ef142c..0daf1bc95360453d1201329218e437ab8e750535 100644 (file)
@@ -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)
This page took 0.058869 seconds and 4 git commands to generate.