V4L/DVB (4859): Fix initializations on some video_ioctl2 handlers
authorMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 20 Nov 2006 15:10:43 +0000 (12:10 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 10 Dec 2006 11:04:59 +0000 (09:04 -0200)
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/videodev.c

index 41ec0c4b35a2a00989ec39d318d1390f628d9624..9024ea2557fd61570fe7f1779cfcb308358300b6 100644 (file)
@@ -1088,9 +1088,13 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
        case VIDIOC_G_AUDIO:
        {
                struct v4l2_audio *p=arg;
+               __u32 index=p->index;
 
                if (!vfd->vidioc_g_audio)
                        break;
+
+               memset(p,0,sizeof(*p));
+               p->index=index;
                dbgarg(cmd, "Get for index=%d\n", p->index);
                ret=vfd->vidioc_g_audio(file, fh, p);
                if (!ret)
@@ -1329,8 +1333,14 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
        case VIDIOC_G_TUNER:
        {
                struct v4l2_tuner *p=arg;
+               __u32 index=p->index;
+
                if (!vfd->vidioc_g_tuner)
                        break;
+
+               memset(p,0,sizeof(*p));
+               p->index=index;
+
                ret=vfd->vidioc_g_tuner(file, fh, p);
                if (!ret)
                        dbgarg (cmd, "index=%d, name=%s, type=%d, "
@@ -1363,6 +1373,9 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
                struct v4l2_frequency *p=arg;
                if (!vfd->vidioc_g_frequency)
                        break;
+
+               memset(p,0,sizeof(*p));
+
                ret=vfd->vidioc_g_frequency(file, fh, p);
                if (!ret)
                        dbgarg (cmd, "tuner=%d, type=%d, frequency=%d\n",