]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-4.9/hwmon-pwm-fan-disable-pwm-if-fetching-cooling-data-fails.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.9 / hwmon-pwm-fan-disable-pwm-if-fetching-cooling-data-fails.patch
CommitLineData
294ccf38
GKH
1From 53f1647da3e8fb3e89066798f0fdc045064d353d Mon Sep 17 00:00:00 2001
2From: Stefan Wahren <stefan.wahren@i2se.com>
3Date: Wed, 3 Apr 2019 14:48:33 +0200
4Subject: hwmon: (pwm-fan) Disable PWM if fetching cooling data fails
5
6From: Stefan Wahren <stefan.wahren@i2se.com>
7
8commit 53f1647da3e8fb3e89066798f0fdc045064d353d upstream.
9
10In case pwm_fan_of_get_cooling_data() fails we should disable the PWM
11just like in the other error cases.
12
13Fixes: 2e5219c77183 ("hwmon: (pwm-fan) Read PWM FAN configuration from device tree")
14Cc: <stable@vger.kernel.org> # 4.14+
15Reported-by: Guenter Rock <linux@roeck-us.net>
16Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
17Signed-off-by: Guenter Roeck <linux@roeck-us.net>
18Signed-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@@ -272,7 +272,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)) {