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: <20240806044928.2j6z2ucnzk6lg5y3@vireshk-i7>
Date: Tue, 6 Aug 2024 10:19:28 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: "Rob Herring (Arm)" <robh@...nel.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
	Nathan Chancellor <nathan@...nel.org>,
	Nick Desaulniers <ndesaulniers@...gle.com>,
	Bill Wendling <morbo@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>,
	kernel test robot <lkp@...el.com>, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] cpufreq: spear: Fix uninitialized variable "i"

On 05-08-24, 14:20, Rob Herring (Arm) wrote:
> The refactoring in commit dca2ef2b7d91 ("cpufreq: spear: Use
> of_property_for_each_u32() instead of open coding") left "i"
> uninitialized. Initialize it to 0.
> 
> Note that gcc doesn't detect this, only clang does.
> 
> Fixes: dca2ef2b7d91 ("cpufreq: spear: Use of_property_for_each_u32() instead of open coding")
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202408030418.gnJDcCpm-lkp@intel.com/
> Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> ---
>  drivers/cpufreq/spear-cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c
> index 4d28147c23f1..f8c16699a68d 100644
> --- a/drivers/cpufreq/spear-cpufreq.c
> +++ b/drivers/cpufreq/spear-cpufreq.c
> @@ -173,7 +173,7 @@ static int spear_cpufreq_probe(struct platform_device *pdev)
>  	struct device_node *np;
>  	struct cpufreq_frequency_table *freq_tbl;
>  	u32 val;
> -	int cnt, i, ret;
> +	int cnt, i = 0, ret;

We don't increment 'i' anymore, don't we need an i++ in:

        freq_tbl[i].frequency = val;

?

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ