All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: rui.zhang@intel.com, grant.likely@secretlab.ca,
	rob.herring@calxeda.com, yongjun_wei@trendmicro.com.cn,
	linux-pm@vger.kernel.org, devicetree-discuss@lists.ozlabs.org
Subject: Re: [PATCH -next v2] thermal: rcar: fix missing unlock on error in rcar_thermal_update_temp()
Date: Sun, 24 Feb 2013 15:54:47 -0800 (PST)	[thread overview]
Message-ID: <87mwutfetd.wl%kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <CAPgLHd8z1nXC1KiyFDReqayrceZCz_tzPUzWjgxjv5hjyFqdJA@mail.gmail.com>


Hi


> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing unlock before return from function rcar_thermal_update_temp()
> in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---

Very nice !

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

>  drivers/thermal/rcar_thermal.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 909bb4b..321a98d 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -145,6 +145,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
>  	struct device *dev = rcar_priv_to_dev(priv);
>  	int i;
>  	int ctemp, old, new;
> +	int ret = -EINVAL;
>  
>  	mutex_lock(&priv->lock);
>  
> @@ -174,7 +175,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
>  
>  	if (!ctemp) {
>  		dev_err(dev, "thermal sensor was broken\n");
> -		return -EINVAL;
> +		goto err_out_unlock;
>  	}
>  
>  	/*
> @@ -192,10 +193,10 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
>  	dev_dbg(dev, "thermal%d  %d -> %d\n", priv->id, priv->ctemp, ctemp);
>  
>  	priv->ctemp = ctemp;
> -
> +	ret = 0;
> +err_out_unlock:
>  	mutex_unlock(&priv->lock);
> -
> -	return 0;
> +	return ret;
>  }
>  
>  static int rcar_thermal_get_temp(struct thermal_zone_device *zone,
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Best regards
---
Kuninori Morimoto

  reply	other threads:[~2013-02-24 23:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-22 13:22 [PATCH -next v2] thermal: rcar: fix missing unlock on error in rcar_thermal_update_temp() Wei Yongjun
2013-02-24 23:54 ` Kuninori Morimoto [this message]
2013-03-25  3:36   ` Kuninori Morimoto

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=87mwutfetd.wl%kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-pm@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=rui.zhang@intel.com \
    --cc=weiyj.lk@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.