From: Dan Carpenter <[email protected]>

The "AUVI_INPUT(tmp)" macro uses "tmp" as an index of an array with
AU0828_MAX_INPUT elements.

Signed-off-by: Dan Carpenter <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Hans Verkuil <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

 drivers/media/video/au0828/au0828-video.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/media/video/au0828/au0828-video.c~drivers-media-video-au0828-au0828-videoc-off-by-one-bug
 drivers/media/video/au0828/au0828-video.c
--- 
a/drivers/media/video/au0828/au0828-video.c~drivers-media-video-au0828-au0828-videoc-off-by-one-bug
+++ a/drivers/media/video/au0828/au0828-video.c
@@ -1105,7 +1105,7 @@ static int vidioc_enum_input(struct file
 
        tmp = input->index;
 
-       if (tmp > AU0828_MAX_INPUT)
+       if (tmp >= AU0828_MAX_INPUT)
                return -EINVAL;
        if (AUVI_INPUT(tmp).type == 0)
                return -EINVAL;
_
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to