lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 6 Feb 2013 07:48:32 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	dirk.brandewie@...il.com
Cc:	linux-kernel@...r.kernel.org, cpufreq@...r.kernel.org,
	Dirk Brandewie <dirk.j.brandewie@...el.com>
Subject: Re: [PATCH 6/7] cpufreq_stats: do not remove sysfs files if frequency
 table is not present

On Tue, Feb 5, 2013 at 11:54 PM,  <dirk.brandewie@...il.com> wrote:
> From: Dirk Brandewie <dirk.brandewie@...il.com>
>
> The sysfs files for cpufreq_stats are created in cpufreq_stats_create_table()
> called from cpufreq_stat_notifier_policy() when a policy is added to
> the cpu. cpufreq_stats_create_table() will not be called if the
> scaling driver does not export a frequency table to cpufreq.  Use the
> same fence on tear down.
>
> Signed-off-by: Dirk Brandewie <dirk.j.brandewie@...el.com>
> ---
>  drivers/cpufreq/cpufreq_stats.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
> index 572124c..fb001e2 100644
> --- a/drivers/cpufreq/cpufreq_stats.c
> +++ b/drivers/cpufreq/cpufreq_stats.c
> @@ -185,6 +185,11 @@ static void cpufreq_stats_free_table(unsigned int cpu)
>  static void cpufreq_stats_free_sysfs(unsigned int cpu)
>  {
>         struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
> +       struct cpufreq_frequency_table *table;
> +
> +       table = cpufreq_frequency_get_table(cpu);
> +       if (!table)
> +               return;

Because we aren't using table later on, i would write it as:

> +       if (!cpufreq_frequency_get_table(cpu))
> +               return;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists