Staging: cx25821: off by one in cx25821_enum_input()
authorDan Carpenter <error27@gmail.com>
Mon, 28 Dec 2009 17:00:24 +0000 (19:00 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 4 Mar 2010 00:42:38 +0000 (16:42 -0800)
The INPUT(n) macro indexes an array of size 2.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/cx25821/cx25821-video.c

index c7c14c7698a7665de42470c36f4359f2e4d1b128..6e710ae067ad0bd258d88d439fc5d0343619e7b3 100644 (file)
@@ -876,7 +876,7 @@ int cx25821_enum_input(struct cx25821_dev *dev, struct v4l2_input *i)
        dprintk(1, "%s()\n", __func__);
 
        n = i->index;
-       if (n > 2)
+       if (n >= 2)
                return -EINVAL;
 
        if (0 == INPUT(n)->type)