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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jan 2021 10:55:11 +0000 (11:55 +0100)
commitc9894c169ec60a43a748736443cf84e789814ea2
treeec746fdc9e1b6eb557bdf3311e3d7880c5beb14b
parent61aad39e2e13bc00ae952975dcaae9b02f357984
iio: common: st_sensors: fix possible infinite loop in st_sensors_irq_thread

commit 40c48fb79b9798954691f24b8ece1d3a7eb1b353 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/common/st_sensors/st_sensors_trigger.c