From: Dan Carpenter Date: Mon, 28 Dec 2009 17:00:24 +0000 (+0200) Subject: Staging: cx25821: off by one in cx25821_enum_input() X-Git-Tag: MMI-PSA29.97-13-9~24618^2~1^2~239 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ed30013207ef3e36da4f39db1298ae53f799e29c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Staging: cx25821: off by one in cx25821_enum_input() The INPUT(n) macro indexes an array of size 2. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/cx25821/cx25821-video.c b/drivers/staging/cx25821/cx25821-video.c index c7c14c7698a7..6e710ae067ad 100644 --- a/drivers/staging/cx25821/cx25821-video.c +++ b/drivers/staging/cx25821/cx25821-video.c @@ -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)