]>
Commit | Line | Data |
---|---|---|
889f4f04 GKH |
1 | From 245a396a9b1a67ac5c3228737c261b3e48708a2a Mon Sep 17 00:00:00 2001 |
2 | From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> | |
3 | Date: Sat, 23 Sep 2017 08:06:18 +0200 | |
4 | Subject: iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()' | |
5 | ||
6 | From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> | |
7 | ||
8 | commit 245a396a9b1a67ac5c3228737c261b3e48708a2a upstream. | |
9 | ||
10 | If 'devm_regulator_get()' fails, we should go through the existing error | |
11 | handling path instead of returning directly, as done is all the other | |
12 | error handling paths in this function. | |
13 | ||
14 | Fixes: 7cc97d77ee8a ("iio: adc: twl4030: Fix ADC[3:6] readings") | |
15 | Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> | |
16 | Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
18 | ||
19 | --- | |
20 | drivers/iio/adc/twl4030-madc.c | 6 ++++-- | |
21 | 1 file changed, 4 insertions(+), 2 deletions(-) | |
22 | ||
23 | --- a/drivers/iio/adc/twl4030-madc.c | |
24 | +++ b/drivers/iio/adc/twl4030-madc.c | |
25 | @@ -866,8 +866,10 @@ static int twl4030_madc_probe(struct pla | |
26 | ||
27 | /* Enable 3v1 bias regulator for MADC[3:6] */ | |
28 | madc->usb3v1 = devm_regulator_get(madc->dev, "vusb3v1"); | |
29 | - if (IS_ERR(madc->usb3v1)) | |
30 | - return -ENODEV; | |
31 | + if (IS_ERR(madc->usb3v1)) { | |
32 | + ret = -ENODEV; | |
33 | + goto err_i2c; | |
34 | + } | |
35 | ||
36 | ret = regulator_enable(madc->usb3v1); | |
37 | if (ret) |