]> err.no Git - linux-2.6/commitdiff
[PATCH] USB: cdc-acm patch to use kzalloc
authorOliver Neukum <oliver@neukum.org>
Mon, 24 Oct 2005 20:42:35 +0000 (22:42 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 28 Oct 2005 23:47:49 +0000 (16:47 -0700)
another one to use kzalloc. Please apply.

Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/cdc-acm.c

index 16ecad30e29cacecc4efdfa082874d16ba441e92..1b4751412970fe2cb4ff7674997217199b632156 100644 (file)
@@ -827,11 +827,10 @@ skip_normal_probe:
                return -ENODEV;
        }
 
-       if (!(acm = kmalloc(sizeof(struct acm), GFP_KERNEL))) {
-               dev_dbg(&intf->dev, "out of memory (acm kmalloc)\n");
+       if (!(acm = kzalloc(sizeof(struct acm), GFP_KERNEL))) {
+               dev_dbg(&intf->dev, "out of memory (acm kzalloc)\n");
                goto alloc_fail;
        }
-       memset(acm, 0, sizeof(struct acm));
 
        ctrlsize = le16_to_cpu(epctrl->wMaxPacketSize);
        readsize = le16_to_cpu(epread->wMaxPacketSize);