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: Ubuntu-5.4-5.4.0-11.14~37995^2~5 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=1a002ebf60c011ed6574b8e3ed9aa85f1ead6a95;p=mirror_ubuntu-focal-kernel.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 e68326f28097..fcf8f2d208a8 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; }