aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.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/usb-serial.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/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index b5c96e74a903..097f4e8488fe 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -564,12 +564,11 @@ static struct usb_serial * create_serial (struct usb_device *dev,
564{ 564{
565 struct usb_serial *serial; 565 struct usb_serial *serial;
566 566
567 serial = kmalloc (sizeof (*serial), GFP_KERNEL); 567 serial = kzalloc(sizeof(*serial), GFP_KERNEL);
568 if (!serial) { 568 if (!serial) {
569 dev_err(&dev->dev, "%s - out of memory\n", __FUNCTION__); 569 dev_err(&dev->dev, "%s - out of memory\n", __FUNCTION__);
570 return NULL; 570 return NULL;
571 } 571 }
572 memset (serial, 0, sizeof(*serial));
573 serial->dev = usb_get_dev(dev); 572 serial->dev = usb_get_dev(dev);
574 serial->type = driver; 573 serial->type = driver;
575 serial->interface = interface; 574 serial->interface = interface;
@@ -778,10 +777,9 @@ int usb_serial_probe(struct usb_interface *interface,
778 serial->num_port_pointers = max_endpoints; 777 serial->num_port_pointers = max_endpoints;
779 dbg("%s - setting up %d port structures for this device", __FUNCTION__, max_endpoints); 778 dbg("%s - setting up %d port structures for this device", __FUNCTION__, max_endpoints);
780 for (i = 0; i < max_endpoints; ++i) { 779 for (i = 0; i < max_endpoints; ++i) {
781 port = kmalloc(sizeof(struct usb_serial_port), GFP_KERNEL); 780 port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL);
782 if (!port) 781 if (!port)
783 goto probe_error; 782 goto probe_error;
784 memset(port, 0x00, sizeof(struct usb_serial_port));
785 port->number = i + serial->minor; 783 port->number = i + serial->minor;
786 port->serial = serial; 784 port->serial = serial;
787 spin_lock_init(&port->lock); 785 spin_lock_init(&port->lock);