aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/pl2303.c
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-02-27 15:29:43 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 17:49:59 -0500
commit80b6ca48321974a6566a1c9048ba34f60420bca6 (patch)
treea350e3cf6b794081c13c89d5b1913b2c1207570d /drivers/usb/serial/pl2303.c
parentd54a5cb6484705f7808b337917cc7598f2f971c3 (diff)
[PATCH] USB: kzalloc() conversion for rest of drivers/usb
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/pl2303.c')
-rw-r--r--drivers/usb/serial/pl2303.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 37c81c08faad..cf2213bae0e0 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -218,10 +218,9 @@ static int pl2303_startup (struct usb_serial *serial)
218 dbg("device type: %d", type); 218 dbg("device type: %d", type);
219 219
220 for (i = 0; i < serial->num_ports; ++i) { 220 for (i = 0; i < serial->num_ports; ++i) {
221 priv = kmalloc (sizeof (struct pl2303_private), GFP_KERNEL); 221 priv = kzalloc(sizeof(struct pl2303_private), GFP_KERNEL);
222 if (!priv) 222 if (!priv)
223 goto cleanup; 223 goto cleanup;
224 memset (priv, 0x00, sizeof (struct pl2303_private));
225 spin_lock_init(&priv->lock); 224 spin_lock_init(&priv->lock);
226 priv->buf = pl2303_buf_alloc(PL2303_BUF_SIZE); 225 priv->buf = pl2303_buf_alloc(PL2303_BUF_SIZE);
227 if (priv->buf == NULL) { 226 if (priv->buf == NULL) {
@@ -383,12 +382,11 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
383 } 382 }
384 } 383 }
385 384
386 buf = kmalloc (7, GFP_KERNEL); 385 buf = kzalloc (7, GFP_KERNEL);
387 if (!buf) { 386 if (!buf) {
388 dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__); 387 dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__);
389 return; 388 return;
390 } 389 }
391 memset (buf, 0x00, 0x07);
392 390
393 i = usb_control_msg (serial->dev, usb_rcvctrlpipe (serial->dev, 0), 391 i = usb_control_msg (serial->dev, usb_rcvctrlpipe (serial->dev, 0),
394 GET_LINE_REQUEST, GET_LINE_REQUEST_TYPE, 392 GET_LINE_REQUEST, GET_LINE_REQUEST_TYPE,