From patchwork Fri Mar 27 12:28:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 6106731 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 73032BF910 for ; Fri, 27 Mar 2015 12:30:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7CA8420212 for ; Fri, 27 Mar 2015 12:30:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8AEFB2034B for ; Fri, 27 Mar 2015 12:30:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932200AbbC0M2i (ORCPT ); Fri, 27 Mar 2015 08:28:38 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:18667 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932199AbbC0M2g (ORCPT ); Fri, 27 Mar 2015 08:28:36 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NLV00H2YEU75070@mailout4.w1.samsung.com>; Fri, 27 Mar 2015 12:32:31 +0000 (GMT) X-AuditID: cbfec7f4-b7f126d000001e9a-3f-55154c4901c9 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id D9.3C.07834.94C45155; Fri, 27 Mar 2015 12:25:45 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NLV00I58ENIRF00@eusync3.samsung.com>; Fri, 27 Mar 2015 12:28:33 +0000 (GMT) From: Krzysztof Kozlowski To: Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Olof Johansson , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH v2 3/3] ARM: EXYNOS: Add missing of_node_put() when parsing power domains Date: Fri, 27 Mar 2015 13:28:25 +0100 Message-id: <1427459305-26625-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1427459305-26625-1-git-send-email-k.kozlowski@samsung.com> References: <1427459305-26625-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xq7qePqKhBuv28Fr8nXSM3eL1C0OL /sevmS02Pb7GanF51xw2ixnn9zFZrD1yl93i1PXPbA4cHr9/TWL02LSqk81j85J6jysnmlg9 +rasYvT4vEkugC2KyyYlNSezLLVI3y6BK2PVwmmMBSd4Krb09bM1MLZzdTFyckgImEisffWS HcIWk7hwbz0biC0ksJRRomOFZBcjF5DdxyQx4/djZpAEm4CxxOblS9hAEiICXYwSs7b8Butg FljEKLHkojOILSwQLbFibxcTiM0ioCrxp+MaWDOvgLvEwaYrUNvkJE4em8wKYnMKeEjcvbKW EWKzu8S9WbfYJzDyLmBkWMUomlqaXFCclJ5rqFecmFtcmpeul5yfu4kREmZfdjAuPmZ1iFGA g1GJh9fgoHCoEGtiWXFl7iFGCQ5mJRFefhfRUCHelMTKqtSi/Pii0pzU4kOMTBycUg2MbGmv PtfNcHx28Idf48zTB+W/R10355dtlpcMezq/Vm22RvYyG9nz9SuW/Iwrnr5u9g5hd/EK5bM+ TcvVCvewfEq6a8k9+Y1OYdkUz2sfpjWEn4y7ZSzl8L41blaQzLJl05fvSZ1v+lWF1Tbv8x4B 1wU6bIzvU3Qb7YxmseZ/3LS94ovDzSgOJZbijERDLeai4kQAouIf9RECAAA= 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 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); }