Skip to content

Commit

Permalink
PM: EM: Decrement policy counter
Browse files Browse the repository at this point in the history
[ Upstream commit c9d8923 ]

In commit e458716 ("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: e458716 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
pierregondois authored and gregkh committed Jun 9, 2022
1 parent 671be14 commit 2d5cf68
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/power/energy_model.c
Expand Up @@ -259,6 +259,8 @@ static void em_cpufreq_update_efficiencies(struct device *dev)
found++;
}

cpufreq_cpu_put(policy);

if (!found)
return;

Expand Down

0 comments on commit 2d5cf68

Please sign in to comment.