diff options
Diffstat (limited to 'drivers/usb/serial/console.c')
-rw-r--r-- | drivers/usb/serial/console.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 3a9073dbfe6a..7167728d764c 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c | |||
@@ -166,19 +166,17 @@ static int usb_console_setup(struct console *co, char *options) | |||
166 | if (serial->type->set_termios) { | 166 | if (serial->type->set_termios) { |
167 | /* build up a fake tty structure so that the open call has something | 167 | /* build up a fake tty structure so that the open call has something |
168 | * to look at to get the cflag value */ | 168 | * to look at to get the cflag value */ |
169 | tty = kmalloc (sizeof (*tty), GFP_KERNEL); | 169 | tty = kzalloc(sizeof(*tty), GFP_KERNEL); |
170 | if (!tty) { | 170 | if (!tty) { |
171 | err ("no more memory"); | 171 | err ("no more memory"); |
172 | return -ENOMEM; | 172 | return -ENOMEM; |
173 | } | 173 | } |
174 | termios = kmalloc (sizeof (*termios), GFP_KERNEL); | 174 | termios = kzalloc(sizeof(*termios), GFP_KERNEL); |
175 | if (!termios) { | 175 | if (!termios) { |
176 | err ("no more memory"); | 176 | err ("no more memory"); |
177 | kfree (tty); | 177 | kfree (tty); |
178 | return -ENOMEM; | 178 | return -ENOMEM; |
179 | } | 179 | } |
180 | memset (tty, 0x00, sizeof(*tty)); | ||
181 | memset (termios, 0x00, sizeof(*termios)); | ||
182 | termios->c_cflag = cflag; | 180 | termios->c_cflag = cflag; |
183 | tty->termios = termios; | 181 | tty->termios = termios; |
184 | port->tty = tty; | 182 | port->tty = tty; |