summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-05-03 04:44:25 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-12 14:04:16 +0200
commit5aaa9cc7ab589893efe8e66bf02f7fc2175a1f5b (patch)
tree29f0b95905b3e0de58fc28f3817b17d9ee1963f2
parentfc31d6f55908759530462998d0464a9f124b1c32 (diff)
downloadop-kernel-dev-5aaa9cc7ab589893efe8e66bf02f7fc2175a1f5b.zip
op-kernel-dev-5aaa9cc7ab589893efe8e66bf02f7fc2175a1f5b.tar.gz
cpufreq: cpufreq-cpu0: Free parent node for error cases
We are freeing parent node in success cases but not in failure cases. Let's do it. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/cpufreq-cpu0.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index ecd8af9..a64eb8b 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -189,7 +189,8 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
if (!np) {
pr_err("failed to find cpu0 node\n");
- return -ENOENT;
+ ret = -ENOENT;
+ goto out_put_parent;
}
cpu_dev = &pdev->dev;
@@ -274,6 +275,8 @@ out_free_table:
opp_free_cpufreq_table(cpu_dev, &freq_table);
out_put_node:
of_node_put(np);
+out_put_parent:
+ of_node_put(parent);
return ret;
}
OpenPOWER on IntegriCloud