mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
iio: pressure: bmp280: Fix NULL pointer exception
commit85dfb43bf6
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:aae9539496
("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>
This commit is contained in:
parent
88a204cc0c
commit
187939163b
@ -1786,7 +1786,7 @@ int bmp280_common_probe(struct device *dev,
|
||||
* however as it happens, the BMP085 shares the chip ID of BMP180
|
||||
* so we look for an IRQ if we have that.
|
||||
*/
|
||||
if (irq > 0 || (chip_id == BMP180_CHIP_ID)) {
|
||||
if (irq > 0 && (chip_id == BMP180_CHIP_ID)) {
|
||||
ret = bmp085_fetch_eoc_irq(dev, name, irq, data);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user