public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	video4linux-list@redhat.com
Subject: [PATCH] bttv: fix missed index check
Date: Tue, 1 Apr 2008 21:49:13 +0400	[thread overview]
Message-ID: <20080401174913.GD7654@cvg> (raw)

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;
 }
 

                 reply	other threads:[~2008-04-01 17:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080401174913.GD7654@cvg \
    --to=gorcunov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=video4linux-list@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox