aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/console.c
diff options
context:
space:
mode:
authorBurman Yan <yan_952@hotmail.com>2006-11-22 13:54:38 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-01 17:25:51 -0500
commit7ac9da10af7ffd94cfd07e097b93d588bbd32b75 (patch)
tree335f931bb41e09ed9fff8c6bc4942f564c6a9ef3 /drivers/usb/serial/console.c
parentafd21ee5abd0fef567dbfa234099304886ff83ce (diff)
USB serial: replace kmalloc+memset with kzalloc
Replace kmalloc+memset with kzalloc Signed-off-by: Yan Burman <yan_952@hotmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/console.c')
-rw-r--r--drivers/usb/serial/console.c6
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;