linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Wei Yongjun <weiyj.lk@gmail.com>
Cc: eduardo.valentin@ti.com, yongjun_wei@trendmicro.com.cn,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] thermal: cpu_cooling: fix return value check in cpufreq_cooling_register()
Date: Wed, 06 Nov 2013 13:17:28 +0800	[thread overview]
Message-ID: <1383715048.2073.9.camel@rzhang1-mobl4> (raw)
In-Reply-To: <CAPgLHd8_-oLvW7ps5way80S10asaN6uy8imjtUaqysQNNTXb7A@mail.gmail.com>

On Fri, 2013-10-25 at 21:55 +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> In case of error, the function thermal_cooling_device_register() returns
> ERR_PTR() and never returns NULL. The NULL test in the return value check
> should be replaced with IS_ERR().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

applied.

thanks,
rui
> ---
>  drivers/thermal/cpu_cooling.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
> index d179028..02a46f2 100644
> --- a/drivers/thermal/cpu_cooling.c
> +++ b/drivers/thermal/cpu_cooling.c
> @@ -469,10 +469,10 @@ cpufreq_cooling_register(const struct cpumask *clip_cpus)
>  
>  	cool_dev = thermal_cooling_device_register(dev_name, cpufreq_dev,
>  						   &cpufreq_cooling_ops);
> -	if (!cool_dev) {
> +	if (IS_ERR(cool_dev)) {
>  		release_idr(&cpufreq_idr, cpufreq_dev->id);
>  		kfree(cpufreq_dev);
> -		return ERR_PTR(-EINVAL);
> +		return cool_dev;
>  	}
>  	cpufreq_dev->cool_dev = cool_dev;
>  	cpufreq_dev->cpufreq_state = 0;
> 
> --
> 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



      reply	other threads:[~2013-11-06  5:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25 13:55 [PATCH] thermal: cpu_cooling: fix return value check in cpufreq_cooling_register() Wei Yongjun
2013-11-06  5:17 ` Zhang Rui [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=1383715048.2073.9.camel@rzhang1-mobl4 \
    --to=rui.zhang@intel.com \
    --cc=eduardo.valentin@ti.com \
    --cc=linux-pm@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).