linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: 俞伟 <yuwei06082130@foxmail.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-pm <linux-pm@vger.kernel.org>,
	yuweieric <yuweieric@163.com>
Subject: Re: [PATCH 1/1] fix cpufreq/cpufreq.c null pointer access issue
Date: Mon, 31 Aug 2015 12:49:20 +0530	[thread overview]
Message-ID: <20150831071920.GB5215@linux> (raw)
In-Reply-To: <tencent_71BE8275037B1C3E4F56914E@qq.com>

On 29-08-15, 01:32, 俞伟 wrote:
> Hi,
> This patch fixes an issue in cpufreq_init_policy().
> 
> Best regards,
> Yu Wei

You have done the right thing in the wrong way.

Firstly, this is not how you send patches. Please read
Documentation/SubmittingPatches for right details..

Secondly, this is even more screwed up as you sent it as html :)

> Subject: [PATCH] cpufreq: print the last governor while restoring governor
> 
> Commit 35afd02e30d6 ("cpufreq: Initialize the governor again while
> restoring policy") clears policy->governor to initialize the governor

This isn't the patch which broke it, but this one:

6e2c89d16d98 ("cpufreq: move call to __find_governor() to cpufreq_init_policy()")

> while restoring governor. The policy->governor is NULL and
> find_governor() returns last used governor matching last_governor
> string, so print last_governor instead of policy->governor->name.
> 

Add this line here:

Fixes: 6e2c89d16d98 ("cpufreq: move call to __find_governor() to cpufreq_init_policy()")

> Signed-off-by: Yu Wei <yuweieric@163.com>
> 
> ---
>  drivers/cpufreq/cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 7a3c30c..5a9e50e 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1072,7 +1072,7 @@ static void cpufreq_init_policy(struct cpufreq_policy
> *policy)
>      gov = find_governor(policy->last_governor);
>      if (gov)
>          pr_debug("Restoring governor %s for cpu %d\n",
> -                policy->governor->name, policy->cpu);
> +                policy->last_governor, policy->cpu);

The right thing to do here is to print gov->name instead.

>      else
>          gov = CPUFREQ_DEFAULT_GOVERNOR;
>  
> --
> 1.9.1
> 
> SECURITY NOTE: file ~/.netrc must not be accessible by others

-- 
viresh

           reply	other threads:[~2015-08-31  7:19 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <tencent_71BE8275037B1C3E4F56914E@qq.com>]

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=20150831071920.GB5215@linux \
    --to=viresh.kumar@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=yuwei06082130@foxmail.com \
    --cc=yuweieric@163.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;
as well as URLs for NNTP newsgroup(s).