iio: light: noa1305: Fix up integration time look up
The current code is always iterating over two fields in the noa1305_int_time_available array. Fix iteration limit, which has to be halved to avoid out of bounds access in case the value that is being looked up is not in the array. Fixes: 025f23cf ("iio: light: noa1305: Make integration time configurable") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Marek Vasut <marex@denx.de> Link: https://patch.msgid.link/20240814191946.81386-1-marex@denx.deSigned-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Showing
Please register or sign in to comment