ti_adc108s102: fix verification off-by-one
Channel IDs start at 0, need to fail if the provided ID equals ADC108S102_CHANNELS, not just larger than it. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
a0c3aadde4
commit
97ccf99b9b
1 changed files with 1 additions and 1 deletions
|
@ -138,7 +138,7 @@ static inline int _verify_entries(struct adc_seq_table *seq_table)
|
||||||
entry = &seq_table->entries[i];
|
entry = &seq_table->entries[i];
|
||||||
|
|
||||||
if (entry->sampling_delay <= 0 ||
|
if (entry->sampling_delay <= 0 ||
|
||||||
entry->channel_id > ADC108S102_CHANNELS) {
|
entry->channel_id >= ADC108S102_CHANNELS) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue