All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/1] fix cpufreq/cpufreq.c null pointer access issue
       [not found] <tencent_71BE8275037B1C3E4F56914E@qq.com>
@ 2015-08-31  7:19 ` Viresh Kumar
  0 siblings, 0 replies; only message in thread
From: Viresh Kumar @ 2015-08-31  7:19 UTC (permalink / raw)
  To: 俞伟; +Cc: Rafael J. Wysocki, linux-kernel, linux-pm, yuweieric

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-31  7:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <tencent_71BE8275037B1C3E4F56914E@qq.com>
2015-08-31  7:19 ` [PATCH 1/1] fix cpufreq/cpufreq.c null pointer access issue Viresh Kumar

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.