Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
[pandora-kernel.git] / drivers / staging / go7007 / go7007-v4l2.c
index 723c1a6..46b4b9f 100644 (file)
@@ -720,7 +720,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
                if (count > 32)
                        count = 32;
 
-               gofh->bufs = kmalloc(count * sizeof(struct go7007_buffer),
+               gofh->bufs = kcalloc(count, sizeof(struct go7007_buffer),
                                     GFP_KERNEL);
 
                if (!gofh->bufs) {
@@ -728,8 +728,6 @@ static int vidioc_reqbufs(struct file *file, void *priv,
                        goto unlock_and_return;
                }
 
-               memset(gofh->bufs, 0, count * sizeof(struct go7007_buffer));
-
                for (i = 0; i < count; ++i) {
                        gofh->bufs[i].go = go;
                        gofh->bufs[i].index = i;