V4L/DVB (5554): Fix: vidioc_g_parm were not zeroing the memory
authorMauro Carvalho Chehab <mchehab@infradead.org>
Tue, 24 Apr 2007 16:40:07 +0000 (13:40 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 27 Apr 2007 18:45:56 +0000 (15:45 -0300)
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/videodev.c

index fdfef0b53315d0426e048def4454336d444056a2..80ac5f86d9e561d494fbd1fa42e411d7cb5d2c4c 100644 (file)
@@ -1404,6 +1404,11 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
        case VIDIOC_G_PARM:
        {
                struct v4l2_streamparm *p=arg;
+               __u32 type=p->type;
+
+               memset(p,0,sizeof(*p));
+               p->type=type;
+
                if (vfd->vidioc_g_parm) {
                        ret=vfd->vidioc_g_parm(file, fh, p);
                } else {
@@ -1415,8 +1420,6 @@ static int __video_do_ioctl(struct inode *inode, struct file *file,
                        v4l2_video_std_construct(&s, vfd->current_norm,
                                                 v4l2_norm_to_name(vfd->current_norm));
 
-                       memset(p,0,sizeof(*p));
-
                        p->parm.capture.timeperframe = s.frameperiod;
                        ret=0;
                }