summaryrefslogtreecommitdiff
path: root/drivers/media/video/v4l2-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/v4l2-ioctl.c')
-rw-r--r--drivers/media/video/v4l2-ioctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 20a571f21577..175688e9489f 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -969,6 +969,11 @@ static long __video_do_ioctl(struct file *file,
if (ret)
break;
+ /* Zero out all fields starting with bytesysed, which is
+ * everything but index and type. */
+ memset(0, &p->bytesused,
+ sizeof(*p) - offsetof(typeof(*p), bytesused));
+
ret = ops->vidioc_querybuf(file, fh, p);
if (!ret)
dbgbuf(cmd, vfd, p);