]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] USB: kzalloc in usbvideo
authorOliver Neukum <oliver@neukum.org>
Fri, 6 Jan 2006 20:35:08 +0000 (21:35 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 20 Mar 2006 22:49:53 +0000 (14:49 -0800)
another for kzalloc.

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

index 63a72e550a1bd049d0346d10d1ea440554d5354f..63d279ec722bda9782ade205b757414a586ccf62 100644 (file)
@@ -690,14 +690,13 @@ int usbvideo_register(
        }
 
        base_size = num_cams * sizeof(struct uvd) + sizeof(struct usbvideo);
-       cams = (struct usbvideo *) kmalloc(base_size, GFP_KERNEL);
+       cams = (struct usbvideo *) kzalloc(base_size, GFP_KERNEL);
        if (cams == NULL) {
                err("Failed to allocate %d. bytes for usbvideo struct", base_size);
                return -ENOMEM;
        }
        dbg("%s: Allocated $%p (%d. bytes) for %d. cameras",
            __FUNCTION__, cams, base_size, num_cams);
-       memset(cams, 0, base_size);
 
        /* Copy callbacks, apply defaults for those that are not set */
        memmove(&cams->cb, cbTbl, sizeof(cams->cb));