]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - drivers/hwmon/lis3lv02d_i2c.c
hwmon: lis3: Release resources in case of failure
[~shefty/rdma-dev.git] / drivers / hwmon / lis3lv02d_i2c.c
index 0074809917a21d53a52e34cec05d5629d8bb61e8..9f4bae07f7194ebff499b2902895dc44c507d974 100644 (file)
@@ -160,7 +160,12 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
 
        if (lis3_dev.reg_ctrl)
                lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF);
+
+       if (ret == 0)
+               return 0;
 fail:
+       if (pdata && pdata->release_resources)
+               pdata->release_resources();
        return ret;
 }