diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2015-10-12 15:32:49 -0400 |
---|---|---|
committer | Kukjin Kim <kgene@kernel.org> | 2015-10-12 15:37:17 -0400 |
commit | 51a6256b00008a3c520f6f31bcd62cd15cb05960 (patch) | |
tree | 11136d56cbee1c172fac585bb36057e19a933e3c | |
parent | 6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff) |
ARM: EXYNOS: Fix double of_node_put() when parsing child power domains
On each next iteration of for_each_compatible_node() the reference
counter for current device node is already decreased by the loop
iterator. The manual call to of_node_get() is required only on loop
break which is not happening here.
The double of_node_get() (with enabled CONFIG_OF_DYNAMIC) lead to
decreasing the counter below expected, initial value.
Fixes: fe4034a3fad7 ("ARM: EXYNOS: Add missing of_node_put() when parsing power domains")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
-rw-r--r-- | arch/arm/mach-exynos/pm_domains.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index 4a87e86dec45..7c21760f590f 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c | |||
@@ -200,15 +200,15 @@ no_clk: | |||
200 | args.args_count = 0; | 200 | args.args_count = 0; |
201 | child_domain = of_genpd_get_from_provider(&args); | 201 | child_domain = of_genpd_get_from_provider(&args); |
202 | if (IS_ERR(child_domain)) | 202 | if (IS_ERR(child_domain)) |
203 | goto next_pd; | 203 | continue; |
204 | 204 | ||
205 | if (of_parse_phandle_with_args(np, "power-domains", | 205 | if (of_parse_phandle_with_args(np, "power-domains", |
206 | "#power-domain-cells", 0, &args) != 0) | 206 | "#power-domain-cells", 0, &args) != 0) |
207 | goto next_pd; | 207 | continue; |
208 | 208 | ||
209 | parent_domain = of_genpd_get_from_provider(&args); | 209 | parent_domain = of_genpd_get_from_provider(&args); |
210 | if (IS_ERR(parent_domain)) | 210 | if (IS_ERR(parent_domain)) |
211 | goto next_pd; | 211 | continue; |
212 | 212 | ||
213 | if (pm_genpd_add_subdomain(parent_domain, child_domain)) | 213 | if (pm_genpd_add_subdomain(parent_domain, child_domain)) |
214 | pr_warn("%s failed to add subdomain: %s\n", | 214 | pr_warn("%s failed to add subdomain: %s\n", |
@@ -216,8 +216,6 @@ no_clk: | |||
216 | else | 216 | else |
217 | pr_info("%s has as child subdomain: %s.\n", | 217 | pr_info("%s has as child subdomain: %s.\n", |
218 | parent_domain->name, child_domain->name); | 218 | parent_domain->name, child_domain->name); |
219 | next_pd: | ||
220 | of_node_put(np); | ||
221 | } | 219 | } |
222 | 220 | ||
223 | return 0; | 221 | return 0; |