]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PM: EM: Decrement policy counter
authorPierre Gondois <Pierre.Gondois@arm.com>
Tue, 26 Apr 2022 14:44:48 +0000 (16:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:30:09 +0000 (10:30 +0200)
[ Upstream commit c9d8923bfbcb63f15ea6cb2b5c8426fc3d96f643 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/power/energy_model.c

index 0153b0ca7b23e86fa65025f24bf659d241e9bfc8..6219aaa454b5b00e2de3db126f66a7235c413c66 100644 (file)
@@ -259,6 +259,8 @@ static void em_cpufreq_update_efficiencies(struct device *dev)
                        found++;
        }
 
+       cpufreq_cpu_put(policy);
+
        if (!found)
                return;