Skip to content

Commit

Permalink
V4L/DVB (4857): Cleans some ioctl structs before calling V4L2 counter…
Browse files Browse the repository at this point in the history
…part

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Mauro Carvalho Chehab committed Dec 10, 2006
1 parent 61cebe9 commit c6aeb11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/media/video/v4l1-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
case VIDIOCGFREQ: /* get frequency */
{
unsigned long *freq = arg;
memset(&freq2,0,sizeof(freq2));

freq2.tuner = 0;
err = drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
Expand All @@ -726,8 +727,8 @@ v4l_compat_translate_ioctl(struct inode *inode,
case VIDIOCSFREQ: /* set frequency */
{
unsigned long *freq = arg;
memset(&freq2,0,sizeof(freq2));

freq2.tuner = 0;
drv(inode, file, VIDIOC_G_FREQUENCY, &freq2);
freq2.frequency = *freq;
err = drv(inode, file, VIDIOC_S_FREQUENCY, &freq2);
Expand All @@ -738,6 +739,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
case VIDIOCGAUDIO: /* get audio properties/controls */
{
struct video_audio *aud = arg;
memset(&aud2,0,sizeof(aud2));

err = drv(inode, file, VIDIOC_G_AUDIO, &aud2);
if (err < 0) {
Expand Down Expand Up @@ -898,6 +900,7 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
int *i = arg;

memset(&buf2,0,sizeof(buf2));
buf2.index = *i;
buf2.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
err = drv(inode, file, VIDIOC_QUERYBUF, &buf2);
Expand Down

0 comments on commit c6aeb11

Please sign in to comment.