[PATCH 67/70] cpufreq: interactive: Put global cpufreq kobject on failure

From: BÃlint Czobor
Date: Tue Oct 27 2015 - 13:37:05 EST


From: Junjie Wu <junjiew@xxxxxxxxxxxxxx>

Fix failure recovery path in cpufreq_governor_interactive(). Call
cpufreq_put_global_kobject() to release cpufreq global kobject upon
governor init failure.

Change-Id: I7a977070b7a3c75c90acccd2c117064ed1a10d0e
Signed-off-by: Junjie Wu <junjiew@xxxxxxxxxxxxxx>
Signed-off-by: BÃlint Czobor <czoborbalint@xxxxxxxxx>
---
drivers/cpufreq/cpufreq_interactive.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c
index 9faa189..2055266 100644
--- a/drivers/cpufreq/cpufreq_interactive.c
+++ b/drivers/cpufreq/cpufreq_interactive.c
@@ -1180,8 +1180,10 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
if (rc) {
kfree(tunables);
policy->governor_data = NULL;
- if (!have_governor_per_policy())
+ if (!have_governor_per_policy()) {
common_tunables = NULL;
+ cpufreq_put_global_kobject();
+ }
return rc;
}

--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/