Skip to contentSkip to conversation

bttv: fix missed index check

PATCH New Cyrill Gorcunov 1 participant 1 message Apr 1, 2008 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bttv: fix missed index check

We should check for proper index first

---

I'm not really familiar with V4L so please check the patch

drivers/media/video/bt8xx/bttv-driver.c +4 -0
Index: linux-2.6.git/drivers/media/video/bt8xx/bttv-driver.c
===================================================================
@@ -3508,8 +3508,12 @@ static int radio_enum_input(struct file 
 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;
 }