Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1437174

Re: [RESEND PATCH] thermal: helpers: Check return value of get_temp

From Rhyland Klein <rklein@nvidia.com>
Newsgroups linux.kernel
Subject Re: [RESEND PATCH] thermal: helpers: Check return value of get_temp
Date 2016-07-05 18:30 +0200
Message-ID <rRBov-5cR-53@gated-at.bofh.it> (permalink)
References <rH62B-7uD-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 patch, has anyone had a chance to
review it yet?

-rhyland

-- 
nvpublic

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [RESEND PATCH] thermal: helpers: Check return value of get_temp Rhyland Klein <rklein@nvidia.com> - 2016-07-05 18:30 +0200

csiph-web