lkml.org 
[lkml]   [2015]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] fix cpufreq/cpufreq.c null pointer access issue
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


\
 
 \ /
  Last update: 2015-08-31 09:41    [W:0.587 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site