"dac_range_table" has 5 elements. Signed-off-by: Dan Carpenter <error27@xxxxxxxxx> 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]; } _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel