summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-01 17:30:24 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-01 17:30:24 -0300
commit78d8c9381f9d8afcbaffe5c8f647554a05e9425a (patch)
treeac6e8aa8200dadfa63df9f5b25f776f77bb234a4 /linux/drivers
parent6b8e1941619bd16379eac9563643a370c2e8c5d6 (diff)
downloadmediapointer-dvb-s2-78d8c9381f9d8afcbaffe5c8f647554a05e9425a.tar.gz
mediapointer-dvb-s2-78d8c9381f9d8afcbaffe5c8f647554a05e9425a.tar.bz2
bttv: Fix some API non-compliances for some audio/input V4L2 calls
From: Mauro Carvalho Chehab <mchehab@infradead.org> Thanks to Cyrill Gorcunov <gorcunov@gmail.com> for pointing this CC: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-driver.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c
index 8c733bf59..6e9ad7290 100644
--- a/linux/drivers/media/video/bt8xx/bttv-driver.c
+++ b/linux/drivers/media/video/bt8xx/bttv-driver.c
@@ -3158,12 +3158,18 @@ static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
static int bttv_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
{
+ if (unlikely(a->index))
+ return -EINVAL;
+
strcpy(a->name, "audio");
return 0;
}
static int bttv_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
{
+ if (unlikely(a->index))
+ return -EINVAL;
+
return 0;
}
@@ -3553,7 +3559,7 @@ static int radio_enum_input(struct file *file, void *priv,
return -EINVAL;
strcpy(i->name, "Radio");
- i->type = V4L2_INPUT_TYPE_TUNER;
+ i->type = V4L2_INPUT_TYPE_TUNER;
return 0;
}
@@ -3561,10 +3567,9 @@ static int radio_enum_input(struct file *file, void *priv,
static int radio_g_audio(struct file *file, void *priv,
struct v4l2_audio *a)
{
- if (a->index != 0)
+ if (unlikely(a->index))
return -EINVAL;
- memset(a, 0, sizeof(*a));
strcpy(a->name, "Radio");
return 0;
@@ -3586,11 +3591,17 @@ static int radio_s_tuner(struct file *file, void *priv,
static int radio_s_audio(struct file *file, void *priv,
struct v4l2_audio *a)
{
+ if (unlikely(a->index))
+ return -EINVAL;
+
return 0;
}
static int radio_s_input(struct file *filp, void *priv, unsigned int i)
{
+ if (unlikely(i->index))
+ return -EINVAL;
+
return 0;
}