From: Oliver Neukum Date: Fri, 6 Jan 2006 20:35:08 +0000 (+0100) Subject: [PATCH] USB: kzalloc in usbvideo X-Git-Tag: v2.6.17-rc1~1176^2~72 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51b208ddf6e492c58609e07fa50bce98bb02cb27;p=linux-2.6 [PATCH] USB: kzalloc in usbvideo another for kzalloc. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/media/usbvideo.c b/drivers/usb/media/usbvideo.c index 63a72e550a..63d279ec72 100644 --- a/drivers/usb/media/usbvideo.c +++ b/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));