public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] Staging: cx25821: off by on in cx25821_vidioc_s_input()
@ 2011-10-07 13:26 Dan Carpenter
  2011-10-11 20:59 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2011-10-07 13:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Leonid V. Fedorenchik, Mauro Carvalho Chehab, Hans Verkuil, devel,
	linux-media, kernel-janitors

If "i" is 2 then when we call cx25821_video_mux() we'd end up going
past the end of the cx25821_boards[dev->board]->input[].

The INPUT() macro obfuscates what's going on in that function so it's
a bit hard to follow.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I don't have this hardware, so I can't actually test this.  Please
review this carefully.

diff --git a/drivers/staging/cx25821/cx25821-video.c b/drivers/staging/cx25821/cx25821-video.c
index 084fc08..acd7c4b 100644
--- a/drivers/staging/cx25821/cx25821-video.c
+++ b/drivers/staging/cx25821/cx25821-video.c
@@ -1312,7 +1312,7 @@ int cx25821_vidioc_s_input(struct file *file, void *priv, unsigned int i)
 			return err;
 	}
 
-	if (i > 2) {
+	if (i >= 2) {
 		dprintk(1, "%s(): -EINVAL\n", __func__);
 		return -EINVAL;
 	}

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-13  6:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-07 13:26 [patch] Staging: cx25821: off by on in cx25821_vidioc_s_input() Dan Carpenter
2011-10-11 20:59 ` Mauro Carvalho Chehab
2011-10-12  8:14   ` Dan Carpenter
2011-10-12  8:29     ` Dan Carpenter
2011-10-13  6:41   ` [patch v2] Staging: cx25821: off by one " Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox