]> git.baikalelectronics.ru Git - kernel.git/commit
iio: pressure: bmp280: Fix NULL pointer exception
authorPhil Elwell <phil@raspberrypi.com>
Fri, 11 Aug 2023 15:58:29 +0000 (16:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Oct 2023 21:08:55 +0000 (23:08 +0200)
commit187939163b97939eb27cde3f45aa3dfad246536a
treec64eeb40667c5b67cc80d339bf51ac0f836419d5
parent88a204cc0c3d89e7cb206567ee12f447d13d868d
iio: pressure: bmp280: Fix NULL pointer exception

commit 85dfb43bf69281adb1f345dfd9a39faf2e5a718d upstream.

The bmp085 EOC IRQ support is optional, but the driver's common probe
function queries the IRQ properties whether or not it exists, which
can trigger a NULL pointer exception. Avoid any exception by making
the query conditional on the possession of a valid IRQ.

Fixes: aae953949651 ("iio: pressure: bmp280: add support for BMP085 EOC interrupt")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230811155829.51208-1-phil@raspberrypi.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/pressure/bmp280-core.c