USB: oti6858: do not call set_termios with uninitialised data
authorJohan Hovold <jhovold@gmail.com>
Wed, 26 Jun 2013 14:47:31 +0000 (16:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 23:24:33 +0000 (16:24 -0700)
Make sure set_termios is not called with uninitialised data at open. The
old termios struct is currently not used, but pass NULL instead to avoid
future problems (e.g. stack data leak).

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/oti6858.c

index baa2ea59b92108d51737078ec0a7ab183e77d28e..a2080ac7b7e5d696d89bee64f6b2ab72af1add3a 100644 (file)
@@ -508,7 +508,6 @@ static void oti6858_set_termios(struct tty_struct *tty,
 static int oti6858_open(struct tty_struct *tty, struct usb_serial_port *port)
 {
        struct oti6858_private *priv = usb_get_serial_port_data(port);
-       struct ktermios tmp_termios;
        struct usb_serial *serial = port->serial;
        struct oti6858_control_pkt *buf;
        unsigned long flags;
@@ -559,7 +558,7 @@ static int oti6858_open(struct tty_struct *tty, struct usb_serial_port *port)
 
        /* setup termios */
        if (tty)
-               oti6858_set_termios(tty, port, &tmp_termios);
+               oti6858_set_termios(tty, port, NULL);
 
        return 0;
 }