From: Mauro Carvalho Chehab Date: Wed, 12 Nov 2008 00:15:03 +0000 (-0300) Subject: V4L/DVB (9579): v4l core: a few get ioctls were lacking memory clean X-Git-Tag: v4.13~25579^2~413 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=a56a18c3ed3442a0c049c9b5f0dda918a6e83726;p=mirror_ubuntu-bionic-kernel.git V4L/DVB (9579): v4l core: a few get ioctls were lacking memory clean Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 213c4dd6f72c..98a0bf22e43c 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c @@ -1479,9 +1479,15 @@ static int __video_do_ioctl(struct file *file, case VIDIOC_G_CROP: { struct v4l2_crop *p = arg; + __u32 type; if (!ops->vidioc_g_crop) break; + + type = p->type; + memset(p, 0, sizeof(*p)); + p->type = type; + dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); ret = ops->vidioc_g_crop(file, fh, p); if (!ret) @@ -1502,10 +1508,16 @@ static int __video_do_ioctl(struct file *file, case VIDIOC_CROPCAP: { struct v4l2_cropcap *p = arg; + __u32 type; /*FIXME: Should also show v4l2_fract pixelaspect */ if (!ops->vidioc_cropcap) break; + + type = p->type; + memset(p, 0, sizeof(*p)); + p->type = type; + dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); ret = ops->vidioc_cropcap(file, fh, p); if (!ret) { @@ -1520,6 +1532,9 @@ static int __video_do_ioctl(struct file *file, if (!ops->vidioc_g_jpegcomp) break; + + memset(p, 0, sizeof(*p)); + ret = ops->vidioc_g_jpegcomp(file, fh, p); if (!ret) dbgarg(cmd, "quality=%d, APPn=%d, "