Home Home > GIT Browse > SLE12-SP3-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-21 09:30:52 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-21 09:30:52 +0100
commit272bea3f8ffaa27a5c9dcc9fe4740ac1c76e5f0a (patch)
treef098a3541c50f69886358d1f23d2bec2e02c5d45
parent5d91f2fb14c3bdfbf11a0a7a5f7cf683c4a4947d (diff)
hwmon: (lm80) Fix missing unlock on error in set_fan_div()
(git-fixes). suse-commit: 391cf609349f2100ee0a68a3112a305f16e1e0ba
-rw-r--r--drivers/hwmon/lm80.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/lm80.c b/drivers/hwmon/lm80.c
index cb6606a0470d..be60bd5bab78 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);