Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-14 12:02:59 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-14 12:03:03 +0100
commit9dd5b776408f45b5ed5b7b1543fd567186603fd0 (patch)
treeec06048fd44851a79e913e1e6c1704b3d2a8f6cb
parent40262010d4bff21b4f5476fcab152ae69dfc54fb (diff)
hwmon: (lm80) Fix missing unlock on error in set_fan_div()
(bsc#1051510).
-rw-r--r--patches.drivers/hwmon-lm80-Fix-missing-unlock-on-error-in-set_fan_di.patch39
-rw-r--r--series.conf1
2 files changed, 40 insertions, 0 deletions
diff --git a/patches.drivers/hwmon-lm80-Fix-missing-unlock-on-error-in-set_fan_di.patch b/patches.drivers/hwmon-lm80-Fix-missing-unlock-on-error-in-set_fan_di.patch
new file mode 100644
index 0000000000..0bccce65f8
--- /dev/null
+++ b/patches.drivers/hwmon-lm80-Fix-missing-unlock-on-error-in-set_fan_di.patch
@@ -0,0 +1,39 @@
+From 07bd14ccc3049f9c0147a91a4227a571f981601a Mon Sep 17 00:00:00 2001
+From: Wei Yongjun <weiyongjun1@huawei.com>
+Date: Wed, 26 Dec 2018 11:28:24 +0000
+Subject: [PATCH] hwmon: (lm80) Fix missing unlock on error in set_fan_div()
+Git-commit: 07bd14ccc3049f9c0147a91a4227a571f981601a
+Patch-mainline: v5.0-rc3
+References: bsc#1051510
+
+Add the missing unlock before return from function set_fan_div()
+in the error handling case.
+
+Fixes: c9c63915519b ("hwmon: (lm80) fix a missing check of the status of SMBus read")
+Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/hwmon/lm80.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c
+index 0e30fa00204c..f9b8e3e23a8e 100644
+--- a/drivers/hwmon/lm80.c
++++ b/drivers/hwmon/lm80.c
+@@ -393,8 +393,10 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
+ }
+
+ rv = lm80_read_value(client, LM80_REG_FANDIV);
+- if (rv < 0)
++ if (rv < 0) {
++ mutex_unlock(&data->update_lock);
+ return rv;
++ }
+ reg = (rv & ~(3 << (2 * (nr + 1))))
+ | (data->fan_div[nr] << (2 * (nr + 1)));
+ lm80_write_value(client, LM80_REG_FANDIV, reg);
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index e761fde15a..bcd6be343f 100644
--- a/series.conf
+++ b/series.conf
@@ -20218,6 +20218,7 @@
patches.fixes/selinux-fix-GPF-on-invalid-policy.patch
patches.fixes/Yama-Check-for-pid-death-before-checking-ancestry.patch
patches.fixes/LSM-Check-for-NULL-cred-security-on-free.patch
+ patches.drivers/hwmon-lm80-Fix-missing-unlock-on-error-in-set_fan_di.patch
patches.drm/0001-drm-i915-gvt-Fix-mmap-range-check.patch
patches.drm/0002-omap2fb-Fix-stack-memory-disclosure.patch
patches.drivers/crypto-authenc-fix-parsing-key-with-misaligned-rta_l.patch