Commit a56a18c3 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (9579): v4l core: a few get ioctls were lacking memory clean

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 74d83fa0
...@@ -1479,9 +1479,15 @@ static int __video_do_ioctl(struct file *file, ...@@ -1479,9 +1479,15 @@ static int __video_do_ioctl(struct file *file,
case VIDIOC_G_CROP: case VIDIOC_G_CROP:
{ {
struct v4l2_crop *p = arg; struct v4l2_crop *p = arg;
__u32 type;
if (!ops->vidioc_g_crop) if (!ops->vidioc_g_crop)
break; break;
type = p->type;
memset(p, 0, sizeof(*p));
p->type = type;
dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names));
ret = ops->vidioc_g_crop(file, fh, p); ret = ops->vidioc_g_crop(file, fh, p);
if (!ret) if (!ret)
...@@ -1502,10 +1508,16 @@ static int __video_do_ioctl(struct file *file, ...@@ -1502,10 +1508,16 @@ static int __video_do_ioctl(struct file *file,
case VIDIOC_CROPCAP: case VIDIOC_CROPCAP:
{ {
struct v4l2_cropcap *p = arg; struct v4l2_cropcap *p = arg;
__u32 type;
/*FIXME: Should also show v4l2_fract pixelaspect */ /*FIXME: Should also show v4l2_fract pixelaspect */
if (!ops->vidioc_cropcap) if (!ops->vidioc_cropcap)
break; break;
type = p->type;
memset(p, 0, sizeof(*p));
p->type = type;
dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names));
ret = ops->vidioc_cropcap(file, fh, p); ret = ops->vidioc_cropcap(file, fh, p);
if (!ret) { if (!ret) {
...@@ -1520,6 +1532,9 @@ static int __video_do_ioctl(struct file *file, ...@@ -1520,6 +1532,9 @@ static int __video_do_ioctl(struct file *file,
if (!ops->vidioc_g_jpegcomp) if (!ops->vidioc_g_jpegcomp)
break; break;
memset(p, 0, sizeof(*p));
ret = ops->vidioc_g_jpegcomp(file, fh, p); ret = ops->vidioc_g_jpegcomp(file, fh, p);
if (!ret) if (!ret)
dbgarg(cmd, "quality=%d, APPn=%d, " dbgarg(cmd, "quality=%d, APPn=%d, "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment