[PATCH] bttv: fix missed index check

From: Cyrill Gorcunov
Date: Tue Apr 01 2008 - 13:50:04 EST


We should check for proper index first

Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
---

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

Index: linux-2.6.git/drivers/media/video/bt8xx/bttv-driver.c
===================================================================
--- linux-2.6.git.orig/drivers/media/video/bt8xx/bttv-driver.c 2008-03-21 18:04:39.000000000 +0300
+++ linux-2.6.git/drivers/media/video/bt8xx/bttv-driver.c 2008-04-01 21:29:53.000000000 +0400
@@ -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;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/