* [PATCH] bttv: fix missed index check
@ 2008-04-01 17:49 Cyrill Gorcunov
0 siblings, 0 replies; only message in thread
From: Cyrill Gorcunov @ 2008-04-01 17:49 UTC (permalink / raw)
To: LKML, Andrew Morton; +Cc: Mauro Carvalho Chehab, video4linux-list
We should check for proper index first
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-04-01 17:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-01 17:49 [PATCH] bttv: fix missed index check Cyrill Gorcunov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox