lkml.org 
[lkml]   [2022]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1] PM: EM: Decrement policy counter
Date
From: Pierre Gondois <Pierre.Gondois@arm.com>

Fixes: e458716a92b57 ("PM: EM: Mark inefficiencies in CPUFreq")
In the above commit, 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.

Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
kernel/power/energy_model.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index 0153b0ca7b23..6219aaa454b5 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;

--
2.25.1
\
 
 \ /
  Last update: 2022-04-26 16:46    [W:0.034 / U:1.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site