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
commit589f347291aef4cc84a58d5a3355023f0b7f6d0e (patch)
tree98e4e469df9ebf4957a74469e67f7d7f6d546ebb
parentecbd4c59d8068cb7cd7ee01e6e339aceaab584f9 (diff)
hwmon: (lm80) Fix missing unlock on error in set_fan_div()
(bsc#1051510). suse-commit: 9dd5b776408f45b5ed5b7b1543fd567186603fd0
-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 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);