From: Dan Carpenter Date: Sun, 28 Mar 2010 11:48:34 +0000 (+0300) Subject: Staging: comedi: dt2801.c: off by one issue X-Git-Tag: MMI-PSA29.97-13-9~23841^2^2~489 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4ca62584a495f97869c1cbc5a61a140a38c8f375;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git Staging: comedi: dt2801.c: off by one issue "dac_range_table" has 5 elements. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- 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]; }