Skip to content

Commit 0141f85

Browse files
tititiou36gregkh
authored andcommitted
iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'
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: 7cc97d7 ("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>
1 parent 4590ed7 commit 0141f85

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/iio/adc/twl4030-madc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,10 @@ static int twl4030_madc_probe(struct platform_device *pdev)
866866

867867
/* Enable 3v1 bias regulator for MADC[3:6] */
868868
madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1");
869-
if (IS_ERR(madc->usb3v1))
870-
return -ENODEV;
869+
if (IS_ERR(madc->usb3v1)) {
870+
ret = -ENODEV;
871+
goto err_i2c;
872+
}
871873

872874
ret = regulator_enable(madc->usb3v1);
873875
if (ret)

0 commit comments

Comments
 (0)