From patchwork Wed Apr 22 13:17:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 6256011 Return-Path: X-Original-To: patchwork-linux-arm@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 CF18F9F389 for ; Wed, 22 Apr 2015 13:21:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E16C2035B for ; Wed, 22 Apr 2015 13:21:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 81E54201B9 for ; Wed, 22 Apr 2015 13:21:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YkuY6-00049J-3O; Wed, 22 Apr 2015 13:18:42 +0000 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YkuXi-000436-1x for linux-arm-kernel@lists.infradead.org; Wed, 22 Apr 2015 13:18:18 +0000 Received: by paboj16 with SMTP id oj16so272917806pab.0 for ; Wed, 22 Apr 2015 06:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ueg3b1VanadXbNKsBbjbCIC9zKzOjd85HQF+IUHCpvo=; b=P2c4W9PEJhzdxTv1SAVKqAhXFos67oyBnkEebtz3T8LE53uOMODa2r3QMzmYp2jMnl +ck0AUgoN8hHjIOYVXTg8uh6fZXS1yUew8EsfoMyj/77yqVjxaKLPwaA6DQ8t3Rz++TP FNA3CA206RPctLcNYmlHJcMvE59gk/N5ran6WRjZQEwgiX82sFRKIug/6ZUyr/jzXBTS EdwKiEVS2qrcajhGc3nqnvIIX9NVJs5osu8kG3xIoj27XkbRm0wyxUHHXeWy9kni4OwQ gkPMrkOEhOZamWNl0/JgKSGU5wawf6xY/EhdInhZtGYlZeDASknJ0TloJ14RTxZOnVga GAhg== X-Received: by 10.66.221.193 with SMTP id qg1mr45975303pac.134.1429708676955; Wed, 22 Apr 2015 06:17:56 -0700 (PDT) Received: from localhost.localdomain ([125.130.175.98]) by mx.google.com with ESMTPSA id sz7sm5193014pab.22.2015.04.22.06.17.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Apr 2015 06:17:56 -0700 (PDT) From: Krzysztof Kozlowski To: Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v2 3/3] ARM: EXYNOS: Add missing of_node_put() when parsing power domains Date: Wed, 22 Apr 2015 22:17:10 +0900 Message-Id: <1429708630-19810-3-git-send-email-k.kozlowski.k@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429708630-19810-1-git-send-email-k.kozlowski.k@gmail.com> References: <1429708630-19810-1-git-send-email-k.kozlowski.k@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150422_061818_271140_EB42FEEA X-CRM114-Status: GOOD ( 11.61 ) X-Spam-Score: -0.8 (/) Cc: Krzysztof Kozlowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Krzysztof Kozlowski Add missing of_node_put() to: 1. Error return path if allocating memory for exynos_pm_domain failed. 2. Second iteration over power domains if a child domain was not present or was incomplete. Signed-off-by: Krzysztof Kozlowski Reported-by: Karol Wrona --- Changes since v1: 1. New patch. --- arch/arm/mach-exynos/pm_domains.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index 61c32ccc9f7a..1a90c5da2fd7 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -138,6 +138,7 @@ static __init int exynos4_pm_init_power_domain(void) if (!pd) { pr_err("%s: failed to allocate memory for domain\n", __func__); + of_node_put(np); return -ENOMEM; } @@ -209,15 +210,15 @@ no_clk: args.args_count = 0; child_domain = of_genpd_get_from_provider(&args); if (!child_domain) - continue; + goto next_pd; if (of_parse_phandle_with_args(np, "power-domains", "#power-domain-cells", 0, &args) != 0) - continue; + goto next_pd; parent_domain = of_genpd_get_from_provider(&args); if (!parent_domain) - continue; + goto next_pd; if (pm_genpd_add_subdomain(parent_domain, child_domain)) pr_warn("%s failed to add subdomain: %s\n", @@ -225,6 +226,7 @@ no_clk: else pr_info("%s has as child subdomain: %s.\n", parent_domain->name, child_domain->name); +next_pd: of_node_put(np); }