Browse Source

usb serial: kill another case we pass NULL and shouldn't

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox 17 years ago
parent
commit
7cc7ee2826
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/usb/serial/console.c

+ 3 - 1
drivers/usb/serial/console.c

@@ -164,6 +164,7 @@ static int usb_console_setup(struct console *co, char *options)
 	}
 	}
 
 
 	if (serial->type->set_termios) {
 	if (serial->type->set_termios) {
+		struct ktermios dummy;
 		/* build up a fake tty structure so that the open call has something
 		/* build up a fake tty structure so that the open call has something
 		 * to look at to get the cflag value */
 		 * to look at to get the cflag value */
 		tty = kzalloc(sizeof(*tty), GFP_KERNEL);
 		tty = kzalloc(sizeof(*tty), GFP_KERNEL);
@@ -177,12 +178,13 @@ static int usb_console_setup(struct console *co, char *options)
 			kfree (tty);
 			kfree (tty);
 			return -ENOMEM;
 			return -ENOMEM;
 		}
 		}
+		memset(&dummy, 0, sizeof(struct ktermios));
 		termios->c_cflag = cflag;
 		termios->c_cflag = cflag;
 		tty->termios = termios;
 		tty->termios = termios;
 		port->tty = tty;
 		port->tty = tty;
 
 
 		/* set up the initial termios settings */
 		/* set up the initial termios settings */
-		serial->type->set_termios(port, NULL);
+		serial->type->set_termios(port, &dummy);
 		port->tty = NULL;
 		port->tty = NULL;
 		kfree (termios);
 		kfree (termios);
 		kfree (tty);
 		kfree (tty);