Skip to content

Commit 91dc90f

Browse files
committed
cpufreq: qcom-cpufreq-hw: Fix uninitialized throttled_freq warning
Commit 6240aaa was supposed to drop the reference count to the OPP, instead it avoided more stuff if the OPP isn't found. This isn't entirely correct. We already have a frequency value available, we just couldn't align it with an OPP in case of IS_ERR(opp). Lets continue with updating thermal pressure, etc, even if we aren't able to find an OPP here. This fixes warning generated by the 'smatch' tool. Fixes: 6240aaa ("cpufreq: qcom-hw: fix the opp entries refcounting") Cc: v5.18+ <[email protected]> # v5.18+ Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent ddf958f commit 91dc90f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/cpufreq/qcom-cpufreq-hw.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,14 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
316316
if (IS_ERR(opp)) {
317317
dev_warn(dev, "Can't find the OPP for throttling: %pe!\n", opp);
318318
} else {
319-
throttled_freq = freq_hz / HZ_PER_KHZ;
320-
321-
/* Update thermal pressure (the boost frequencies are accepted) */
322-
arch_update_thermal_pressure(policy->related_cpus, throttled_freq);
323-
324319
dev_pm_opp_put(opp);
325320
}
326321

322+
throttled_freq = freq_hz / HZ_PER_KHZ;
323+
324+
/* Update thermal pressure (the boost frequencies are accepted) */
325+
arch_update_thermal_pressure(policy->related_cpus, throttled_freq);
326+
327327
/*
328328
* In the unlikely case policy is unregistered do not enable
329329
* polling or h/w interrupt

0 commit comments

Comments
 (0)