lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220426144448.43682-1-pierre.gondois@arm.com>
Date:   Tue, 26 Apr 2022 16:44:48 +0200
From:   Pierre Gondois <pierre.gondois@....com>
To:     linux-kernel@...r.kernel.org
Cc:     cristian.marussi@....com, Ionela.Voinescu@....com,
        Dietmar.Eggemann@....com, Pierre Gondois <Pierre.Gondois@....com>,
        Pierre Gondois <pierre.gondois@....com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Vincent Donnefort <vincent.donnefort@....com>,
        linux-pm@...r.kernel.org
Subject: [PATCH v1] PM: EM: Decrement policy counter

From: Pierre Gondois <Pierre.Gondois@....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@....com>
Signed-off-by: Pierre Gondois <pierre.gondois@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ