From: Rhyland Klein <rklein@nvidia.com>
To: Zhang Rui <rui.zhang@intel.com>, Eduardo Valentin <edubezval@gmail.com>
Cc: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RESEND PATCH] thermal: helpers: Check return value of get_temp
Date: Thu, 23 Jun 2016 13:40:39 -0400 [thread overview]
Message-ID: <e0ec6321-4532-2b19-8631-e4dd81397391@nvidia.com> (raw)
In-Reply-To: <1465232019-12441-1-git-send-email-rklein@nvidia.com>
On 6/6/2016 12:53 PM, Rhyland Klein wrote:
> Check the return value of get_temp, which can fail. If it does, then
> unlock and return the error code.
>
> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
> ---
> drivers/thermal/thermal_helpers.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c
> index 5e1c160944c9..dc260749f8d6 100644
> --- a/drivers/thermal/thermal_helpers.c
> +++ b/drivers/thermal/thermal_helpers.c
> @@ -90,6 +90,10 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
> mutex_lock(&tz->lock);
>
> ret = tz->ops->get_temp(tz, temp);
> + if (!ret) {
> + mutex_unlock(&tz->lock);
> + goto exit;
> + }
>
> if (IS_ENABLED(CONFIG_THERMAL_EMULATION) && tz->emul_temperature) {
> for (count = 0; count < tz->trips; count++) {
>
I haven't seen any comments on this. Has anyone had a chance to take a
look at it yet?
-rhyland
--
nvpublic
next prev parent reply other threads:[~2016-06-23 17:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 16:53 Rhyland Klein
2016-06-23 17:40 ` Rhyland Klein [this message]
2016-07-05 16:22 ` Rhyland Klein
2016-07-28 8:50 ` Zhang Rui
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=e0ec6321-4532-2b19-8631-e4dd81397391@nvidia.com \
--to=rklein@nvidia.com \
--cc=edubezval@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.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
all inboxes | Powered by JetHome®