]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 23 Sep 2017 06:06:18 +0000 (08:06 +0200)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 19 Oct 2017 14:48:50 +0000 (09:48 -0500)
BugLink: http://bugs.launchpad.net/bugs/1723145
commit 245a396a9b1a67ac5c3228737c261b3e48708a2a upstream.

If 'devm_regulator_get()' fails, we should go through the existing error
handling path instead of returning directly, as done is all the other
error handling paths in this function.

Fixes: 7cc97d77ee8a ("iio: adc: twl4030: Fix ADC[3:6] readings")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/iio/adc/twl4030-madc.c

index bd3d37fc214420842be0fb20d5ef74d3fc4c61c0..252f5890311ee0e8b6525c8e9b22f8437fe2ab9d 100644 (file)
@@ -887,8 +887,10 @@ static int twl4030_madc_probe(struct platform_device *pdev)
 
        /* Enable 3v1 bias regulator for MADC[3:6] */
        madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1");
-       if (IS_ERR(madc->usb3v1))
-               return -ENODEV;
+       if (IS_ERR(madc->usb3v1)) {
+               ret = -ENODEV;
+               goto err_i2c;
+       }
 
        ret = regulator_enable(madc->usb3v1);
        if (ret)