Skip to content

Commit

Permalink
Staging: comedi: dt2801.c: off by one issue
Browse files Browse the repository at this point in the history
"dac_range_table" has 5 elements.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 8487d0e commit 4ca6258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/dt2801.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit 4ca6258

Please sign in to comment.