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] [day] [month] [year] [list]
Message-ID: <20240807062634.egqwyeqwjpvwjwsb@vireshk-i7>
Date: Wed, 7 Aug 2024 11:56:34 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Rob Herring <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 06-08-24, 10:08, Rob Herring wrote:
> On Mon, Aug 5, 2024 at 10:49 PM Viresh Kumar <viresh.kumar@...aro.org> wrote:
> > We don't increment 'i' anymore, don't we need an i++ in:
> >
> >         freq_tbl[i].frequency = val;
> >
> > ?
> 
> Sigh. Yes.

Fixed the original commit with this, hope this doesn't add any new
bugs:

diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c
index 777f7f5b3671..d8ab5b01d46d 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, ret, i = 0;

        np = of_cpu_device_node_get(0);
        if (!np) {
@@ -199,7 +199,7 @@ static int spear_cpufreq_probe(struct platform_device *pdev)
        }

        of_property_for_each_u32(np, "cpufreq_tbl", val)
-               freq_tbl[i].frequency = val;
+               freq_tbl[i++].frequency = val;

        freq_tbl[cnt].frequency = CPUFREQ_TABLE_END;

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ