]>
Commit | Line | Data |
---|---|---|
3c5af0be GKH |
1 | From 53f1647da3e8fb3e89066798f0fdc045064d353d Mon Sep 17 00:00:00 2001 |
2 | From: Stefan Wahren <stefan.wahren@i2se.com> | |
3 | Date: Wed, 3 Apr 2019 14:48:33 +0200 | |
4 | Subject: hwmon: (pwm-fan) Disable PWM if fetching cooling data fails | |
5 | ||
6 | From: Stefan Wahren <stefan.wahren@i2se.com> | |
7 | ||
8 | commit 53f1647da3e8fb3e89066798f0fdc045064d353d upstream. | |
9 | ||
10 | In case pwm_fan_of_get_cooling_data() fails we should disable the PWM | |
11 | just like in the other error cases. | |
12 | ||
13 | Fixes: 2e5219c77183 ("hwmon: (pwm-fan) Read PWM FAN configuration from device tree") | |
14 | Cc: <stable@vger.kernel.org> # 4.14+ | |
15 | Reported-by: Guenter Rock <linux@roeck-us.net> | |
16 | Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> | |
17 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | drivers/hwmon/pwm-fan.c | 2 +- | |
22 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
23 | ||
24 | --- a/drivers/hwmon/pwm-fan.c | |
25 | +++ b/drivers/hwmon/pwm-fan.c | |
26 | @@ -260,7 +260,7 @@ static int pwm_fan_probe(struct platform | |
27 | ||
28 | ret = pwm_fan_of_get_cooling_data(&pdev->dev, ctx); | |
29 | if (ret) | |
30 | - return ret; | |
31 | + goto err_pwm_disable; | |
32 | ||
33 | ctx->pwm_fan_state = ctx->pwm_fan_max_state; | |
34 | if (IS_ENABLED(CONFIG_THERMAL)) { |