diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-04-21 13:41:56 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-05-13 17:54:57 +0100 |
commit | 279c3a2a5eb2c1054fbe38e5c33be08584229047 (patch) | |
tree | b7122a76b0fe5f908856a497c0e07b460d516053 /include/linux/lapb.h | |
parent | 27b2ed5b6d53cd62fc61c3f259ae52f5cac23b66 (diff) |
iio: adc: palmas: fix off by one bugs
Valid values for "adc_chan" are zero to (PALMAS_ADC_CH_MAX - 1).
Smatch detects some buffer overflows caused by this:
drivers/iio/adc/palmas_gpadc.c:721 palmas_gpadc_read_event_value() error: buffer overflow 'adc->thresholds' 16 <= 16
drivers/iio/adc/palmas_gpadc.c:758 palmas_gpadc_write_event_value() error: buffer overflow 'adc->thresholds' 16 <= 16
The effect of this bug in other functions is more complicated but
obviously we should fix all of them.
Fixes: a99544c6c883 ("iio: adc: palmas: add support for iio threshold events")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/14fee94a-7db7-4371-b7d6-e94d86b9561e@kili.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/lapb.h')
0 files changed, 0 insertions, 0 deletions