iio: common: st_sensors: fix possible infinite loop in st_sensors_irq_thread
authorLorenzo Bianconi <lorenzo@kernel.org>
Tue, 8 Dec 2020 14:36:40 +0000 (15:36 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 14 Jan 2021 20:56:57 +0000 (20:56 +0000)
commit40c48fb79b9798954691f24b8ece1d3a7eb1b353
treeec2b93da91c26e9447b0c0617481c4129621746f
parentefd597b2839a9895e8a98fcb0b76d2f545802cd4
iio: common: st_sensors: fix possible infinite loop in st_sensors_irq_thread

Return a boolean value in st_sensors_new_samples_available routine in
order to avoid an infinite loop in st_sensors_irq_thread if
stat_drdy.addr is not defined or stat_drdy read fails

Fixes: 90efe05562921 ("iio: st_sensors: harden interrupt handling")
Reported-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/c9ec69ed349e7200c779fd7a5bf04c1aaa2817aa.1607438132.git.lorenzo@kernel.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/st_sensors/st_sensors_trigger.c