Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1737964

[PATCH 1/3] iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'

From Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Newsgroups linux.kernel
Subject [PATCH 1/3] iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'
Date 2017-09-23 08:10 +0200
Message-ID <usLNv-7Vv-1@gated-at.bofh.it> (permalink)
References <usLNv-7Vv-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/iio/adc/twl4030-madc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 1edd99f0c5e5..80ab2ed70b85 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -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)
-- 
2.11.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-09-23 08:10 +0200
  [PATCH 2/3] iio: adc: twl4030: Disable the vusb3v1 rugulator in the error handling path of 'twl4030_madc_probe()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-09-23 08:10 +0200
    Re: [PATCH 2/3] iio: adc: twl4030: Disable the vusb3v1 rugulator in  the error handling path of 'twl4030_madc_probe()' Jonathan Cameron <jic23@kernel.org> - 2017-09-24 14:10 +0200
  [PATCH 3/3] iio: adc: twl4030: Return an error if we can not enable the vusb3v1 regulator in 'twl4030_madc_probe()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-09-23 08:10 +0200
    Re: [PATCH 3/3] iio: adc: twl4030: Return an error if we can not  enable the vusb3v1 regulator in 'twl4030_madc_probe()' Jonathan Cameron <jic23@kernel.org> - 2017-09-24 14:10 +0200
  Re: [PATCH 1/3] iio: adc: twl4030: Fix an error handling path in  'twl4030_madc_probe()' Jonathan Cameron <jic23@kernel.org> - 2017-09-24 14:00 +0200

csiph-web