From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org, Wei Yongjun <weiyongjun1@huawei.com>,
Guenter Roeck <linux@roeck-us.net>
Subject: request for 4.14-stable: 07bd14ccc304 ("hwmon: (lm80) Fix missing unlock on error in set_fan_div()")
Date: Tue, 19 Feb 2019 21:55:25 +0000 [thread overview]
Message-ID: <20190219215525.tldji4ywlql3rmnl@debian> (raw)
[-- Attachment #1: Type: text/plain, Size: 146 bytes --]
Hi Greg,
This was not marked for stable but the commit which it fixes is in
stable.
Please apply to your queue of 4.14-stable.
--
Regards
Sudip
[-- Attachment #2: 0001-hwmon-lm80-Fix-missing-unlock-on-error-in-set_fan_di.patch --]
[-- Type: text/x-diff, Size: 1250 bytes --]
From f32d692377ac234158dbcbb393d0b32a3c8980df 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()
commit 07bd14ccc3049f9c0147a91a4227a571f981601a upstream
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>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
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.11.0
next reply other threads:[~2019-02-19 21:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-19 21:55 Sudip Mukherjee [this message]
2019-02-21 4:00 ` request for 4.14-stable: 07bd14ccc304 ("hwmon: (lm80) Fix missing unlock on error in set_fan_div()") Sasha Levin
2019-02-21 11:39 ` Greg Kroah-Hartman
2019-02-21 11:39 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190219215525.tldji4ywlql3rmnl@debian \
--to=sudipm.mukherjee@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux@roeck-us.net \
--cc=stable@vger.kernel.org \
--cc=weiyongjun1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox