powercap: DTPM: Fix missing cpufreq_cpu_put() calls
authorLukasz Luba <lukasz.luba@arm.com>
Fri, 1 Dec 2023 12:32:05 +0000 (12:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:45:25 +0000 (18:45 +0100)
commitaa581b37dae993214bd9a06ae64be46cce6b51c2
tree9973649c65684e7c47c445c37850c7db3b8fe373
parent9e5d3096742daef9b33338ab564114c7d15e5c9e
powercap: DTPM: Fix missing cpufreq_cpu_put() calls

commit bdefd9913bdd453991ef756b6f7176e8ad80d786 upstream.

The policy returned by cpufreq_cpu_get() has to be released with
the help of cpufreq_cpu_put() to balance its kobject reference counter
properly.

Add the missing calls to cpufreq_cpu_put() in the code.

Fixes: 0aea2e4ec2a2 ("powercap/dtpm_cpu: Reset per_cpu variable in the release function")
Fixes: 0e8f68d7f048 ("powercap/drivers/dtpm: Add CPU energy model based support")
Cc: v5.16+ <stable@vger.kernel.org> # v5.16+
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/powercap/dtpm_cpu.c