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: 6255981 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 75B9A9F389 for ; Wed, 22 Apr 2015 13:18:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE6792037E for ; Wed, 22 Apr 2015 13:18:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A757B2035D for ; Wed, 22 Apr 2015 13:18:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756403AbbDVNSR (ORCPT ); Wed, 22 Apr 2015 09:18:17 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33676 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756530AbbDVNR5 (ORCPT ); Wed, 22 Apr 2015 09:17:57 -0400 Received: by paboj16 with SMTP id oj16so272917804pab.0; 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 Cc: Krzysztof Kozlowski 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> 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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); }