Skip to content

Commit

Permalink
cpufreq: cpufreq-cpu0: Free parent node for error cases
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed May 12, 2013
1 parent fc31d6f commit 5aaa9cc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/cpufreq/cpufreq-cpu0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -274,6 +275,8 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
opp_free_cpufreq_table(cpu_dev, &freq_table);
out_put_node:
of_node_put(np);
out_put_parent:
of_node_put(parent);
return ret;
}

Expand Down

0 comments on commit 5aaa9cc

Please sign in to comment.