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]
Message-ID: <5179726E.9020003@intel.com>
Date:	Thu, 25 Apr 2013 20:14:06 +0200
From:	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
To:	Arnd Bergmann <arnd@...db.de>
CC:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	Viresh Kumar <viresh.kumar@...aro.org>
Subject: Re: [PATCH 14/21] cpufreq: pxa2xx: initialize variables

On 4/25/2013 7:28 PM, Arnd Bergmann wrote:
> gcc-3.8 correctly found that the variables set by find_freq_tables()
> are not initialized if this function is called on something other
> than a pxa2xx or pxa3xx:
>
> pxa2xx-cpufreq.c: In function 'pxa_verify_policy':
> pxa2xx-cpufreq.c:272:6: warning: 'pxa_freqs_table' may be used uninitialized in this function [-Wmaybe-uninitialized]
> pxa2xx-cpufreq.c: In function 'pxa_set_target':
> pxa2xx-cpufreq.c:345:23: warning: 'pxa_freq_settings' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Rather than adding a bogus initialization that would let us
> get a little further before crashing, add an explicit BUG().
> We know that this code is designed to run on only these cpus,
> so this will fix the build warning and give a more helpful
> diagnostic if the code ever changes to run on other machines.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Cc: Viresh Kumar <viresh.kumar@...aro.org>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

OK, applied.

Can you please CC future cpufreq changes to linux-pm@...r.kernel.org?  
That'd make the handling of them much easier.

Thanks,
Rafael


> ---
>   drivers/cpufreq/pxa2xx-cpufreq.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c
> index fe4c55b..9e5bc8e 100644
> --- a/drivers/cpufreq/pxa2xx-cpufreq.c
> +++ b/drivers/cpufreq/pxa2xx-cpufreq.c
> @@ -221,10 +221,11 @@ static void find_freq_tables(struct cpufreq_frequency_table **freq_table,
>   			*pxa_freqs = pxa255_turbo_freqs;
>   			*freq_table = pxa255_turbo_freq_table;
>   		}
> -	}
> -	if (cpu_is_pxa27x()) {
> +	} else if (cpu_is_pxa27x()) {
>   		*pxa_freqs = pxa27x_freqs;
>   		*freq_table = pxa27x_freq_table;
> +	} else {
> +		BUG();
>   	}
>   }
>   

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
z siedziba w Gdansku
ul. Slowackiego 173
80-298 Gdansk

Sad Rejonowy Gdansk Polnoc w Gdansku, 
VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, 
numer KRS 101882

NIP 957-07-52-316
Kapital zakladowy 200.000 zl

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ