From: Guenter Roeck <linux@roeck-us.net>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Jean Delvare <jdelvare@suse.com>, Kangjie Lu <kjlu@umn.edu>,
linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] hwmon: (lm80) Fix missing unlock on error in set_fan_div()
Date: Wed, 26 Dec 2018 07:41:06 -0800 [thread overview]
Message-ID: <20181226154106.GA20541@roeck-us.net> (raw)
In-Reply-To: <1545823704-73836-1-git-send-email-weiyongjun1@huawei.com>
On Wed, Dec 26, 2018 at 11:28:24AM +0000, Wei Yongjun wrote:
> 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>
Applied.
Thanks,
Guenter
> ---
> 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 0e30fa0..f9b8e3e 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);
prev parent reply other threads:[~2018-12-26 15:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-26 11:28 [PATCH -next] hwmon: (lm80) Fix missing unlock on error in set_fan_div() Wei Yongjun
2018-12-26 15:41 ` Guenter Roeck [this message]
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=20181226154106.GA20541@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kjlu@umn.edu \
--cc=linux-hwmon@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