iio: pressure: bmp280: Fix NULL pointer exception
authorPhil Elwell <phil@raspberrypi.com>
Fri, 11 Aug 2023 15:58:29 +0000 (16:58 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 11 Sep 2023 19:12:59 +0000 (20:12 +0100)
commit85dfb43bf69281adb1f345dfd9a39faf2e5a718d
treeb5198f153772fb99e00abfe35587b66eb8de82f6
parent9a85653ed3b9a9b7b31d95a34b64b990c3d33ca1
iio: pressure: bmp280: Fix NULL pointer exception

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>
drivers/iio/pressure/bmp280-core.c