diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2011-10-13 09:41:41 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-04 00:33:55 +0400 |
commit | 567a23f4389f86c10355ae89909d6d87f312d1a0 (patch) | |
tree | 2d9819a0995945ba4dbe0b7ef86f17cd411d53c6 /drivers/media/video/cx25821/cx25821-video.c | |
parent | 8c4343e5909f956140229b0d960dc7a9c4fd4bdd (diff) | |
download | linux-567a23f4389f86c10355ae89909d6d87f312d1a0.tar.xz |
[media] cx25821: off by one in cx25821_vidioc_s_input()
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. And as Mauro points out the hard coded 2 is
not very helpful.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25821/cx25821-video.c')
-rw-r--r-- | drivers/media/video/cx25821/cx25821-video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/cx25821/cx25821-video.c b/drivers/media/video/cx25821/cx25821-video.c index 084fc0899e13..4d6907cda75b 100644 --- a/drivers/media/video/cx25821/cx25821-video.c +++ b/drivers/media/video/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 >= CX25821_NR_INPUT) { dprintk(1, "%s(): -EINVAL\n", __func__); return -EINVAL; } |