aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2006-01-06 15:35:08 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 17:49:53 -0500
commit51b208ddf6e492c58609e07fa50bce98bb02cb27 (patch)
tree3c656451163254ab88323e520cacf650459c8189
parentb10b4177881c50f22a79832558054f2e42be5cfa (diff)
[PATCH] USB: kzalloc in usbvideo
another for kzalloc. Signed-off-by: Oliver Neukum <oliver@neukum.name> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/media/usbvideo.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/media/usbvideo.c b/drivers/usb/media/usbvideo.c
index 63a72e550a1b..63d279ec722b 100644
--- a/drivers/usb/media/usbvideo.c
+++ b/drivers/usb/media/usbvideo.c
@@ -690,14 +690,13 @@ int usbvideo_register(
690 } 690 }
691 691
692 base_size = num_cams * sizeof(struct uvd) + sizeof(struct usbvideo); 692 base_size = num_cams * sizeof(struct uvd) + sizeof(struct usbvideo);
693 cams = (struct usbvideo *) kmalloc(base_size, GFP_KERNEL); 693 cams = (struct usbvideo *) kzalloc(base_size, GFP_KERNEL);
694 if (cams == NULL) { 694 if (cams == NULL) {
695 err("Failed to allocate %d. bytes for usbvideo struct", base_size); 695 err("Failed to allocate %d. bytes for usbvideo struct", base_size);
696 return -ENOMEM; 696 return -ENOMEM;
697 } 697 }
698 dbg("%s: Allocated $%p (%d. bytes) for %d. cameras", 698 dbg("%s: Allocated $%p (%d. bytes) for %d. cameras",
699 __FUNCTION__, cams, base_size, num_cams); 699 __FUNCTION__, cams, base_size, num_cams);
700 memset(cams, 0, base_size);
701 700
702 /* Copy callbacks, apply defaults for those that are not set */ 701 /* Copy callbacks, apply defaults for those that are not set */
703 memmove(&cams->cb, cbTbl, sizeof(cams->cb)); 702 memmove(&cams->cb, cbTbl, sizeof(cams->cb));