aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/console.c')
-rw-r--r--drivers/usb/serial/console.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 9386e216d681..0362654d3b52 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -164,6 +164,7 @@ static int usb_console_setup(struct console *co, char *options)
164 } 164 }
165 165
166 if (serial->type->set_termios) { 166 if (serial->type->set_termios) {
167 struct ktermios dummy;
167 /* build up a fake tty structure so that the open call has something 168 /* build up a fake tty structure so that the open call has something
168 * to look at to get the cflag value */ 169 * to look at to get the cflag value */
169 tty = kzalloc(sizeof(*tty), GFP_KERNEL); 170 tty = kzalloc(sizeof(*tty), GFP_KERNEL);
@@ -177,12 +178,13 @@ static int usb_console_setup(struct console *co, char *options)
177 kfree (tty); 178 kfree (tty);
178 return -ENOMEM; 179 return -ENOMEM;
179 } 180 }
181 memset(&dummy, 0, sizeof(struct ktermios));
180 termios->c_cflag = cflag; 182 termios->c_cflag = cflag;
181 tty->termios = termios; 183 tty->termios = termios;
182 port->tty = tty; 184 port->tty = tty;
183 185
184 /* set up the initial termios settings */ 186 /* set up the initial termios settings */
185 serial->type->set_termios(port, NULL); 187 serial->type->set_termios(port, &dummy);
186 port->tty = NULL; 188 port->tty = NULL;
187 kfree (termios); 189 kfree (termios);
188 kfree (tty); 190 kfree (tty);