From: Cyrill Gorcunov Date: Tue, 1 Apr 2008 20:49:13 +0000 (-0300) Subject: V4L/DVB (7461): bttv: fix missed index check X-Git-Tag: v2.6.25-rc9~96^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=1a002ebf60c011ed6574b8e3ed9aa85f1ead6a95;p=linux-2.6-omap-h63xx.git V4L/DVB (7461): bttv: fix missed index check We should check for proper index first Signed-off-by: Cyrill Gorcunov Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index e68326f2809..fcf8f2d208a 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/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; }