]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.92/iio-adc-twl4030-fix-an-error-handling-path-in-twl4030_madc_probe.patch
drop drm patch
[thirdparty/kernel/stable-queue.git] / releases / 4.4.92 / iio-adc-twl4030-fix-an-error-handling-path-in-twl4030_madc_probe.patch
CommitLineData
889f4f04
GKH
1From 245a396a9b1a67ac5c3228737c261b3e48708a2a Mon Sep 17 00:00:00 2001
2From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
3Date: Sat, 23 Sep 2017 08:06:18 +0200
4Subject: iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'
5
6From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
7
8commit 245a396a9b1a67ac5c3228737c261b3e48708a2a upstream.
9
10If 'devm_regulator_get()' fails, we should go through the existing error
11handling path instead of returning directly, as done is all the other
12error handling paths in this function.
13
14Fixes: 7cc97d77ee8a ("iio: adc: twl4030: Fix ADC[3:6] readings")
15Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
16Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
17Signed-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)