linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] comedi: off by one issue
@ 2010-03-28 11:48 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-03-28 11:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Bill Pemberton, Andrea Gelmini, Mithlesh Thukral, devel,
	linux-kernel, kernel-janitors

"dac_range_table" has 5 elements.

Signed-off-by: Dan Carpenter <error27@gmail.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];
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-28 11:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-28 11:48 [patch] comedi: off by one issue Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).