From patchwork Mon Oct 12 01:26:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 7371821 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 64EDC9F1B9 for ; Mon, 12 Oct 2015 01:27:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 878852094C for ; Mon, 12 Oct 2015 01:27:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A694B20956 for ; Mon, 12 Oct 2015 01:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752750AbbJLB1U (ORCPT ); Sun, 11 Oct 2015 21:27:20 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:46901 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752657AbbJLB1U (ORCPT ); Sun, 11 Oct 2015 21:27:20 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NW300MY32PH5U20@mailout4.w1.samsung.com>; Mon, 12 Oct 2015 02:27:17 +0100 (BST) X-AuditID: cbfec7f5-f794b6d000001495-89-561b0c757871 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 13.F4.05269.57C0B165; Mon, 12 Oct 2015 02:27:17 +0100 (BST) Received: from localhost.localdomain ([10.252.80.64]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NW300BBG2PBE460@eusync4.samsung.com>; Mon, 12 Oct 2015 02:27:17 +0100 (BST) From: Krzysztof Kozlowski To: Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: EXYNOS: Fix double of_node_put() when parsing child power domains Date: Mon, 12 Oct 2015 10:26:57 +0900 Message-id: <1444613217-8926-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPJMWRmVeSWpSXmKPExsVy+t/xa7qlPNJhBrt7WS1evzC06H/8mtli 0+NrrBaXd81hs5hxfh+TA6vHplWdbB6bl9R79G1ZxejxeZNcAEsUl01Kak5mWWqRvl0CV8a0 w9tYCtbzVLx+voOxgXEiVxcjJ4eEgInE1Q9L2SFsMYkL99azdTFycQgJLGWUOPfwLjNIQkjg P6PE9uZoEJtNwFhi8/IlYEUiAnuBija/ZwJJCAtESkxbsIoVxGYRUJXoeL4JLM4r4Cbx8s1J FogNchInj01mncDItYCRYRWjaGppckFxUnqukV5xYm5xaV66XnJ+7iZGiLe/7mBceszqEKMA B6MSDy/HFqkwIdbEsuLK3EOMEhzMSiK8UVVAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rwzd70P ERJITyxJzU5NLUgtgskycXBKNTBWn3rA7lt/O0pYgy0wqvwHw21ZMfP7EqLaPLd/dE/mntr9 LaF2icA5VTm7psnVemcWnLu1//aSQ9NvcmiWTFBTlJ6qev33GbXJfzQL2PZyfLyyzSZT5SXj MYdb+3viHq4QmhBo4LNaaFL9wTWlOfaWKm5z3bIqbH1U+5+5X5gqszti35o9f72VWIozEg21 mIuKEwEGqm9g8gEAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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;