[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250930103006.octwlx53p2shwq2v@vireshk-i7>
Date: Tue, 30 Sep 2025 16:00:06 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: webgeek1234@...il.com
Cc: Krzysztof Kozlowski <krzk@...nel.org>, Rob Herring <robh@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH v2 1/8] cpufreq: tegra186: add OPP support and set
bandwidth
On 09-09-25, 01:21, Aaron Kling via B4 Relay wrote:
> +static int tegra_cpufreq_set_bw(struct cpufreq_policy *policy, unsigned long freq_khz)
> +{
> + struct tegra186_cpufreq_data *data = cpufreq_get_driver_data();
> + struct dev_pm_opp *opp __free(put_opp);
The usage here looks incorrect..
> + struct device *dev;
> + int ret;
> +
> + dev = get_cpu_device(policy->cpu);
> + if (!dev)
> + return -ENODEV;
On failure, we would return from here with a garbage `opp` pointer, which the
OPP core may try to free ?
Moving the variable definition here would fix that.
> +
> + opp = dev_pm_opp_find_freq_exact(dev, freq_khz * HZ_PER_KHZ, true);
> + if (IS_ERR(opp))
> + return PTR_ERR(opp);
> +
> + ret = dev_pm_opp_set_opp(dev, opp);
> + if (ret)
> + data->icc_dram_bw_scaling = false;
> +
> + return ret;
> +}
--
viresh
Powered by blists - more mailing lists