From linux-usb-devel-admin@lists.sourceforge.net Fri Jan 6 12:52:07 2006 From: Oliver Neukum To: Greg KH Content-Disposition: inline Message-Id: <200601062135.09101.oliver@neukum.org> Subject: USB: kzalloc in usbvideo Date: Fri, 6 Jan 2006 21:35:08 +0100 another for kzalloc. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/media/usbvideo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- gregkh-2.6.orig/drivers/usb/media/usbvideo.c +++ gregkh-2.6/drivers/usb/media/usbvideo.c @@ -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));