[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20100328114834.GT5069@bicker>
Date: Sun, 28 Mar 2010 14:48:34 +0300
From: Dan Carpenter <error27@...il.com>
To: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Bill Pemberton <wfp5p@...ginia.edu>,
Andrea Gelmini <andrea.gelmini@...ma.net>,
Mithlesh Thukral <mithlesh@...syssoft.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] comedi: off by one issue
"dac_range_table" has 5 elements.
Signed-off-by: Dan Carpenter <error27@...il.com>
diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c
index 3f365ae..83fb6e5 100644
--- a/drivers/staging/comedi/drivers/dt2801.c
+++ b/drivers/staging/comedi/drivers/dt2801.c
@@ -472,7 +472,7 @@ static const struct comedi_lrange *dac_range_table[] = {
static const struct comedi_lrange *dac_range_lkup(int opt)
{
- if (opt < 0 || opt > 5)
+ if (opt < 0 || opt >= 5)
return &range_unknown;
return dac_range_table[opt];
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists