Staging: comedi: dt2801.c: off by one issue
authorDan Carpenter <error27@gmail.com>
Sun, 28 Mar 2010 11:48:34 +0000 (14:48 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:35:39 +0000 (11:35 -0700)
"dac_range_table" has 5 elements.

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

index 3f365aee48221f35c6df3561563cf18dc5ab0250..83fb6e56c3e9cb25ffb1bca209efa18887ace644 100644 (file)
@@ -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];
 }