Browse Source

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>
Cyrill Gorcunov 17 years ago
parent
commit
1a002ebf60
1 changed files with 4 additions and 0 deletions
  1. 4 0
      drivers/media/video/bt8xx/bttv-driver.c

+ 4 - 0
drivers/media/video/bt8xx/bttv-driver.c

@@ -3518,8 +3518,12 @@ 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)
+		return -EINVAL;
+
 	memset(a, 0, sizeof(*a));
 	strcpy(a->name, "Radio");
+
 	return 0;
 }