All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kukjin Kim <kgene@kernel.org>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kukjin Kim <kgene@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: EXYNOS: Fix double of_node_put() when parsing child power domains
Date: Tue, 13 Oct 2015 04:11:02 +0900	[thread overview]
Message-ID: <561C05C6.6080105@kernel.org> (raw)
In-Reply-To: <1444613217-8926-1-git-send-email-k.kozlowski@samsung.com>

On 10/12/15 10:26, Krzysztof Kozlowski wrote:
> 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.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Fixes: fe4034a3fad7 ("ARM: EXYNOS: Add missing of_node_put() when parsing power domains")
> ---
>  arch/arm/mach-exynos/pm_domains.c | 8 +++-----
>  1 file 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:
>  		args.args_count = 0;
>  		child_domain = of_genpd_get_from_provider(&args);
>  		if (IS_ERR(child_domain))
> -			goto next_pd;
> +			continue;
>  
>  		if (of_parse_phandle_with_args(np, "power-domains",
>  					 "#power-domain-cells", 0, &args) != 0)
> -			goto next_pd;
> +			continue;
>  
>  		parent_domain = of_genpd_get_from_provider(&args);
>  		if (IS_ERR(parent_domain))
> -			goto next_pd;
> +			continue;
>  
>  		if (pm_genpd_add_subdomain(parent_domain, child_domain))
>  			pr_warn("%s failed to add subdomain: %s\n",
> @@ -216,8 +216,6 @@ no_clk:
>  		else
>  			pr_info("%s has as child subdomain: %s.\n",
>  				parent_domain->name, child_domain->name);
> -next_pd:
> -		of_node_put(np);
>  	}
>  
>  	return 0;

Looks good to me, applied.

Thanks,
Kukjin

WARNING: multiple messages have this Message-ID (diff)
From: kgene@kernel.org (Kukjin Kim)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: EXYNOS: Fix double of_node_put() when parsing child power domains
Date: Tue, 13 Oct 2015 04:11:02 +0900	[thread overview]
Message-ID: <561C05C6.6080105@kernel.org> (raw)
In-Reply-To: <1444613217-8926-1-git-send-email-k.kozlowski@samsung.com>

On 10/12/15 10:26, Krzysztof Kozlowski wrote:
> 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.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Fixes: fe4034a3fad7 ("ARM: EXYNOS: Add missing of_node_put() when parsing power domains")
> ---
>  arch/arm/mach-exynos/pm_domains.c | 8 +++-----
>  1 file 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:
>  		args.args_count = 0;
>  		child_domain = of_genpd_get_from_provider(&args);
>  		if (IS_ERR(child_domain))
> -			goto next_pd;
> +			continue;
>  
>  		if (of_parse_phandle_with_args(np, "power-domains",
>  					 "#power-domain-cells", 0, &args) != 0)
> -			goto next_pd;
> +			continue;
>  
>  		parent_domain = of_genpd_get_from_provider(&args);
>  		if (IS_ERR(parent_domain))
> -			goto next_pd;
> +			continue;
>  
>  		if (pm_genpd_add_subdomain(parent_domain, child_domain))
>  			pr_warn("%s failed to add subdomain: %s\n",
> @@ -216,8 +216,6 @@ no_clk:
>  		else
>  			pr_info("%s has as child subdomain: %s.\n",
>  				parent_domain->name, child_domain->name);
> -next_pd:
> -		of_node_put(np);
>  	}
>  
>  	return 0;

Looks good to me, applied.

Thanks,
Kukjin

  reply	other threads:[~2015-10-12 19:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12  1:26 [PATCH] ARM: EXYNOS: Fix double of_node_put() when parsing child power domains Krzysztof Kozlowski
2015-10-12  1:26 ` Krzysztof Kozlowski
2015-10-12 19:11 ` Kukjin Kim [this message]
2015-10-12 19:11   ` Kukjin Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561C05C6.6080105@kernel.org \
    --to=kgene@kernel.org \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.