mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 14:44:12 +00:00
hwmon: (lm80) Fix missing unlock on error in set_fan_div()
[ Upstream commit07bd14ccc3
] Add the missing unlock before return from function set_fan_div() in the error handling case. Fixes:c9c6391551
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
be62fb6c28
commit
986ac4c8f1
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue