diff options
Diffstat (limited to 'drivers/media/video/v4l1-compat.c')
-rw-r--r-- | drivers/media/video/v4l1-compat.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 1d899e2db394..8a13e595304e 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c | |||
@@ -350,6 +350,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
350 | struct video_buffer *buffer = arg; | 350 | struct video_buffer *buffer = arg; |
351 | 351 | ||
352 | memset(buffer, 0, sizeof(*buffer)); | 352 | memset(buffer, 0, sizeof(*buffer)); |
353 | memset(&fbuf2, 0, sizeof(fbuf2)); | ||
353 | 354 | ||
354 | err = drv(inode, file, VIDIOC_G_FBUF, &fbuf2); | 355 | err = drv(inode, file, VIDIOC_G_FBUF, &fbuf2); |
355 | if (err < 0) { | 356 | if (err < 0) { |
@@ -616,6 +617,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
616 | case VIDIOCSPICT: /* set tone controls & partial capture format */ | 617 | case VIDIOCSPICT: /* set tone controls & partial capture format */ |
617 | { | 618 | { |
618 | struct video_picture *pict = arg; | 619 | struct video_picture *pict = arg; |
620 | memset(&fbuf2, 0, sizeof(fbuf2)); | ||
619 | 621 | ||
620 | set_v4l_control(inode, file, | 622 | set_v4l_control(inode, file, |
621 | V4L2_CID_BRIGHTNESS, pict->brightness, drv); | 623 | V4L2_CID_BRIGHTNESS, pict->brightness, drv); |
@@ -708,12 +710,22 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
708 | } | 710 | } |
709 | case VIDIOCSTUNER: /* select a tuner input */ | 711 | case VIDIOCSTUNER: /* select a tuner input */ |
710 | { | 712 | { |
711 | err = 0; | 713 | struct video_tuner *tun = arg; |
714 | struct v4l2_tuner t; | ||
715 | memset(&t,0,sizeof(t)); | ||
716 | |||
717 | t.index=tun->tuner; | ||
718 | |||
719 | err = drv(inode, file, VIDIOC_S_INPUT, &t); | ||
720 | if (err < 0) | ||
721 | dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %d\n",err); | ||
722 | |||
712 | break; | 723 | break; |
713 | } | 724 | } |
714 | case VIDIOCGFREQ: /* get frequency */ | 725 | case VIDIOCGFREQ: /* get frequency */ |
715 | { | 726 | { |
716 | unsigned long *freq = arg; | 727 | unsigned long *freq = arg; |
728 | memset(&freq2,0,sizeof(freq2)); | ||
717 | 729 | ||
718 | freq2.tuner = 0; | 730 | freq2.tuner = 0; |
719 | err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); | 731 | err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); |
@@ -726,8 +738,8 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
726 | case VIDIOCSFREQ: /* set frequency */ | 738 | case VIDIOCSFREQ: /* set frequency */ |
727 | { | 739 | { |
728 | unsigned long *freq = arg; | 740 | unsigned long *freq = arg; |
741 | memset(&freq2,0,sizeof(freq2)); | ||
729 | 742 | ||
730 | freq2.tuner = 0; | ||
731 | drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); | 743 | drv(inode, file, VIDIOC_G_FREQUENCY, &freq2); |
732 | freq2.frequency = *freq; | 744 | freq2.frequency = *freq; |
733 | err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2); | 745 | err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2); |
@@ -738,6 +750,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
738 | case VIDIOCGAUDIO: /* get audio properties/controls */ | 750 | case VIDIOCGAUDIO: /* get audio properties/controls */ |
739 | { | 751 | { |
740 | struct video_audio *aud = arg; | 752 | struct video_audio *aud = arg; |
753 | memset(&aud2,0,sizeof(aud2)); | ||
741 | 754 | ||
742 | err = drv(inode, file, VIDIOC_G_AUDIO, &aud2); | 755 | err = drv(inode, file, VIDIOC_G_AUDIO, &aud2); |
743 | if (err < 0) { | 756 | if (err < 0) { |
@@ -898,6 +911,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
898 | { | 911 | { |
899 | int *i = arg; | 912 | int *i = arg; |
900 | 913 | ||
914 | memset(&buf2,0,sizeof(buf2)); | ||
901 | buf2.index = *i; | 915 | buf2.index = *i; |
902 | buf2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 916 | buf2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
903 | err = drv(inode, file, VIDIOC_QUERYBUF, &buf2); | 917 | err = drv(inode, file, VIDIOC_QUERYBUF, &buf2); |