Commit 7cc7ee28263e89793ae4d21e6e0102404c9a037b

Authored by Alan Cox
Committed by Greg Kroah-Hartman
1 parent adb5dca17d

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>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

drivers/usb/serial/console.c
... ... @@ -164,6 +164,7 @@
164 164 }
165 165  
166 166 if (serial->type->set_termios) {
  167 + struct ktermios dummy;
167 168 /* build up a fake tty structure so that the open call has something
168 169 * to look at to get the cflag value */
169 170 tty = kzalloc(sizeof(*tty), GFP_KERNEL);
170 171  
... ... @@ -177,12 +178,13 @@
177 178 kfree (tty);
178 179 return -ENOMEM;
179 180 }
  181 + memset(&dummy, 0, sizeof(struct ktermios));
180 182 termios->c_cflag = cflag;
181 183 tty->termios = termios;
182 184 port->tty = tty;
183 185  
184 186 /* set up the initial termios settings */
185   - serial->type->set_termios(port, NULL);
  187 + serial->type->set_termios(port, &dummy);
186 188 port->tty = NULL;
187 189 kfree (termios);
188 190 kfree (tty);