summaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2022-04-26 16:44:48 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-05-11 19:15:14 +0200
commitc9d8923bfbcb63f15ea6cb2b5c8426fc3d96f643 (patch)
tree09e7d95f0fc446624eca78b0bf76c991cf3e9037 /kernel/power
parent985a67709a66c456414182ed179544786e00321e (diff)
PM: EM: Decrement policy counter
In commit e458716a92b57 ("PM: EM: Mark inefficiencies in CPUFreq"), cpufreq_cpu_get() is called without a cpufreq_cpu_put(), permanently increasing the reference counts of the policy struct. Decrement the reference count once the policy struct is not used anymore. Fixes: e458716a92b57 ("PM: EM: Mark inefficiencies in CPUFreq") Tested-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Vincent Donnefort <vincent.donnefort@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/energy_model.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index 092513575e4e..6c373f2960e7 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -259,6 +259,8 @@ static void em_cpufreq_update_efficiencies(struct device *dev)
found++;
}
+ cpufreq_cpu_put(policy);
+
if (!found)
return;