bmc150_magn_gpio_probe() may return some error codes, so better check them. Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx> --- drivers/iio/magnetometer/bmc150_magn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c index f1b6a4dc40ea..e1f804b2b244 100644 --- a/drivers/iio/magnetometer/bmc150_magn.c +++ b/drivers/iio/magnetometer/bmc150_magn.c @@ -920,8 +920,13 @@ static int bmc150_magn_probe(struct i2c_client *client, indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = &bmc150_magn_info; - if (client->irq <= 0) + if (client->irq <= 0) { client->irq = bmc150_magn_gpio_probe(client); + if (client->irq < 0) { + ret = client->irq; + goto err_poweroff; + } + } if (client->irq > 0) { data->dready_trig = devm_iio_trigger_alloc(&client->dev, -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html