summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2025-10-22 18:15:05 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2025-11-09 15:57:04 +0300
commit97289f6accca405d63149e56774912c8be85f76b (patch)
treec7e9d5f34051d3f9a0dd1f62305645581d96ecf3 /include
parentc6763b15c49edc4926a8c6cd8cd2f01d49134d74 (diff)
downloadlinux-97289f6accca405d63149e56774912c8be85f76b.tar.xz
iio: adc: ad7124: fix possible OOB array access
Reorder the channel bounds check before using it to index into the channels array in ad7124_release_config_slot(). This prevents reading past the end of the array. The value read from invalid memory was not used, so this was mostly harmless, but we still should not be reading out of bounds in the first place. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-iio/aPi6V-hcaKReSNWK@stanley.mountain/ Fixes: 9065197e0d41 ("iio: adc: ad7124: change setup reg allocation strategy") Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions