[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200530092052.ksuncmgx3cahokzo@vireshk-i7>
Date: Sat, 30 May 2020 14:50:52 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>,
Georgi Djakov <georgi.djakov@...aro.org>,
Sibi Sankar <sibis@...eaurora.org>,
Matthias Kaehlcke <mka@...omium.org>,
Rajendra Nayak <rnayak@...eaurora.org>,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] opp: avoid uninitialized-variable use
On 29-05-20, 22:17, Arnd Bergmann wrote:
> An uninitialized pointer is passed into another function but
> ignored there:
>
> drivers/opp/core.c:875:32: error: variable 'opp' is uninitialized when used here [-Werror,-Wuninitialized]
> ret = _set_opp_bw(opp_table, opp, dev, true);
> ^~~
> drivers/opp/core.c:849:34: note: initialize the variable 'opp' to silence this warning
> struct dev_pm_opp *old_opp, *opp;
> ^
>
> gcc no longer warns about this, but it seems it really should,
> so change the code to just pass a NULL pointer here.
>
> See-also: 78a5255ffb6a ("Stop the ad-hoc games with -Wno-maybe-initialized")
> Fixes: c57afacc9270 ("opp: Remove bandwidth votes when target_freq is zero")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> drivers/opp/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index df12c3804533..7302f2631f8d 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -872,7 +872,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
> goto put_opp_table;
> }
>
> - ret = _set_opp_bw(opp_table, opp, dev, true);
> + ret = _set_opp_bw(opp_table, NULL, dev, true);
> if (ret)
> return ret;
>
Not sure why people are still seeing this, I pushed a fix for this 2
days back.
--
viresh
Powered by blists - more mailing lists