From 4ca62584a495f97869c1cbc5a61a140a38c8f375 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sun, 28 Mar 2010 14:48:34 +0300 Subject: [PATCH] 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 --- drivers/staging/comedi/drivers/dt2801.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; } -- 2.20.1