aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-10-18 04:24:18 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-25 15:18:40 -0400
commit7cc7ee28263e89793ae4d21e6e0102404c9a037b (patch)
treeca54d962a6faf99fbdd1396e43ef5383328a8f2c /drivers/usb
parentadb5dca17dde297b685d57ec68fa0e5490feee8b (diff)
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>
Diffstat (limited to 'drivers/usb')
-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);