aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-ioctl.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-11-11 19:15:03 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:31 -0500
commita56a18c3ed3442a0c049c9b5f0dda918a6e83726 (patch)
treeed28a5e3faca88f1bd31bf4488e30181fc8bc7e2 /drivers/media/video/v4l2-ioctl.c
parent74d83fa0241f603a4067f071a88ef8b9a7c415a0 (diff)
V4L/DVB (9579): v4l core: a few get ioctls were lacking memory clean
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-ioctl.c')
-rw-r--r--drivers/media/video/v4l2-ioctl.c15
1 files changed, 15 insertions, 0 deletions
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,
1479 case VIDIOC_G_CROP: 1479 case VIDIOC_G_CROP:
1480 { 1480 {
1481 struct v4l2_crop *p = arg; 1481 struct v4l2_crop *p = arg;
1482 __u32 type;
1482 1483
1483 if (!ops->vidioc_g_crop) 1484 if (!ops->vidioc_g_crop)
1484 break; 1485 break;
1486
1487 type = p->type;
1488 memset(p, 0, sizeof(*p));
1489 p->type = type;
1490
1485 dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); 1491 dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names));
1486 ret = ops->vidioc_g_crop(file, fh, p); 1492 ret = ops->vidioc_g_crop(file, fh, p);
1487 if (!ret) 1493 if (!ret)
@@ -1502,10 +1508,16 @@ static int __video_do_ioctl(struct file *file,
1502 case VIDIOC_CROPCAP: 1508 case VIDIOC_CROPCAP:
1503 { 1509 {
1504 struct v4l2_cropcap *p = arg; 1510 struct v4l2_cropcap *p = arg;
1511 __u32 type;
1505 1512
1506 /*FIXME: Should also show v4l2_fract pixelaspect */ 1513 /*FIXME: Should also show v4l2_fract pixelaspect */
1507 if (!ops->vidioc_cropcap) 1514 if (!ops->vidioc_cropcap)
1508 break; 1515 break;
1516
1517 type = p->type;
1518 memset(p, 0, sizeof(*p));
1519 p->type = type;
1520
1509 dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names)); 1521 dbgarg(cmd, "type=%s\n", prt_names(p->type, v4l2_type_names));
1510 ret = ops->vidioc_cropcap(file, fh, p); 1522 ret = ops->vidioc_cropcap(file, fh, p);
1511 if (!ret) { 1523 if (!ret) {
@@ -1520,6 +1532,9 @@ static int __video_do_ioctl(struct file *file,
1520 1532
1521 if (!ops->vidioc_g_jpegcomp) 1533 if (!ops->vidioc_g_jpegcomp)
1522 break; 1534 break;
1535
1536 memset(p, 0, sizeof(*p));
1537
1523 ret = ops->vidioc_g_jpegcomp(file, fh, p); 1538 ret = ops->vidioc_g_jpegcomp(file, fh, p);
1524 if (!ret) 1539 if (!ret)
1525 dbgarg(cmd, "quality=%d, APPn=%d, " 1540 dbgarg(cmd, "quality=%d, APPn=%d, "