Hi,

another one for kzalloc.

        Regards
                Oliver

Signed-off-by: Oliver Neukum <[EMAIL PROTECTED]>

--- linux-2.6.15-vanilla/drivers/usb/media/w9968cf.c    2006-01-03 
04:21:10.000000000 +0100
+++ linux-2.6.15/drivers/usb/media/w9968cf.c    2006-01-06 21:12:39.000000000 
+0100
@@ -713,13 +713,12 @@
        /* Allocate memory for the isochronous transfer buffers */
        for (i = 0; i < W9968CF_URBS; i++) {
                if (!(cam->transfer_buffer[i] =
-                     kmalloc(W9968CF_ISO_PACKETS*p_size, GFP_KERNEL))) {
+                     kzalloc(W9968CF_ISO_PACKETS*p_size, GFP_KERNEL))) {
                        DBG(1, "Couldn't allocate memory for the isochronous "
                               "transfer buffers (%u bytes)", 
                            p_size * W9968CF_ISO_PACKETS)
                        return -ENOMEM;
                }
-               memset(cam->transfer_buffer[i], 0, W9968CF_ISO_PACKETS*p_size);
        }
 
        /* Allocate memory for the temporary frame buffer */
@@ -3521,12 +3520,10 @@
                return -ENODEV;
 
        cam = (struct w9968cf_device*)
-                 kmalloc(sizeof(struct w9968cf_device), GFP_KERNEL);
+                 kzalloc(sizeof(struct w9968cf_device), GFP_KERNEL);
        if (!cam)
                return -ENOMEM;
 
-       memset(cam, 0, sizeof(*cam));
-
        init_MUTEX(&cam->dev_sem);
        down(&cam->dev_sem);
 
@@ -3554,21 +3551,19 @@
 
 
        /* Allocate 2 bytes of memory for camera control USB transfers */
-       if (!(cam->control_buffer = (u16*)kmalloc(2, GFP_KERNEL))) {
+       if (!(cam->control_buffer = (u16*)kzalloc(2, GFP_KERNEL))) {
                DBG(1,"Couldn't allocate memory for camera control transfers")
                err = -ENOMEM;
                goto fail;
        }
-       memset(cam->control_buffer, 0, 2);
 
        /* Allocate 8 bytes of memory for USB data transfers to the FSB */
-       if (!(cam->data_buffer = (u16*)kmalloc(8, GFP_KERNEL))) {
+       if (!(cam->data_buffer = (u16*)kzalloc(8, GFP_KERNEL))) {
                DBG(1, "Couldn't allocate memory for data "
                       "transfers to the FSB")
                err = -ENOMEM;
                goto fail;
        }
-       memset(cam->data_buffer, 0, 8);
 
        /* Register the V4L device */
        cam->v4ldev = video_device_alloc();


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to