diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c index 3f365aee4822..83fb6e56c3e9 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]; }