V4L/DVB (7461): bttv: fix missed index check
We should check for proper index first Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
c137918978
commit
1a002ebf60
@@ -3518,8 +3518,12 @@ static int radio_enum_input(struct file *file, void *priv,
|
|||||||
static int radio_g_audio(struct file *file, void *priv,
|
static int radio_g_audio(struct file *file, void *priv,
|
||||||
struct v4l2_audio *a)
|
struct v4l2_audio *a)
|
||||||
{
|
{
|
||||||
|
if (a->index != 0)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
memset(a, 0, sizeof(*a));
|
memset(a, 0, sizeof(*a));
|
||||||
strcpy(a->name, "Radio");
|
strcpy(a->name, "Radio");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user