From patchwork Fri Mar 1 08:56:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C85EE1399 for ; Fri, 1 Mar 2019 08:57:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6A512F672 for ; Fri, 1 Mar 2019 08:57:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9BED2F6BD; Fri, 1 Mar 2019 08:57:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3EE612F672 for ; Fri, 1 Mar 2019 08:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=igTUwu4dIqPlbiSJfKntlUObsIBB6iTcZKO3BFA44Z4=; b=LSSMMx23K/FI+6 CtzWagvJ35hvjXo4P/TimzNX90SiNoLpQ+0dGxeM7vvjYkZJ007B5Gb4QXbrP0DKaD02mzpeuCBpA 34leSMUVCedBHE6Zyk6ZICeZcBL4e/UpjXnFkw0t/AHXnwZWaNUqL7nMgM/Cji64952V2XQeEyi4X x00M1YIgmRFea6k7CRio2+qYrIxq6IRPuRP7NrjPEVG9HmU+V8HOytn0s5siujFogtLBWlc5ucZy4 tG/fE9F42+YZU9A2D7u1PdMyqo801VS7XDIULPo51SROUqUAmJq+IAj6g2vbs6OtZQA5s1qJb4Rn2 tea6vkzGp0YMeGY5e07A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdyj-0000PO-IW; Fri, 01 Mar 2019 08:57:13 +0000 Received: from mxhk.zte.com.cn ([63.217.80.70]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdyf-0000Mp-7a; Fri, 01 Mar 2019 08:57:11 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 6DC6C3FD8DD54C244F7B; Fri, 1 Mar 2019 16:56:56 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218ul86086315; Fri, 1 Mar 2019 16:56:47 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116572652-2498911 ; Fri, 1 Mar 2019 16:57:26 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 01/15] ARM: actions: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:42 +0800 Message-Id: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:26, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:56:32 X-MAIL: mse01.zte.com.cn x218ul86086315 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005709_424249_B2E3A35C X-CRM114-Status: GOOD ( 11.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-actions/platsmp.c:112:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 103, but without a corresponding object release within this function. ./arch/arm/mach-actions/platsmp.c:124:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 115, but without a corresponding object release within this function. ./arch/arm/mach-actions/platsmp.c:137:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 128, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: "Andreas Färber" Cc: Manivannan Sadhasivam Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-actions/platsmp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c index 4fd479c..1a8e078 100644 --- a/arch/arm/mach-actions/platsmp.c +++ b/arch/arm/mach-actions/platsmp.c @@ -107,6 +107,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus) } timer_base_addr = of_iomap(node, 0); + of_node_put(node); if (!timer_base_addr) { pr_err("%s: could not map timer registers\n", __func__); return; @@ -119,6 +120,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus) } sps_base_addr = of_iomap(node, 0); + of_node_put(node); if (!sps_base_addr) { pr_err("%s: could not map sps registers\n", __func__); return; @@ -132,6 +134,7 @@ static void __init s500_smp_prepare_cpus(unsigned int max_cpus) } scu_base_addr = of_iomap(node, 0); + of_node_put(node); if (!scu_base_addr) { pr_err("%s: could not map scu registers\n", __func__); return; From patchwork Fri Mar 1 08:56:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD1A8180E for ; Fri, 1 Mar 2019 08:57:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A1002F672 for ; Fri, 1 Mar 2019 08:57:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CFB02F6BD; Fri, 1 Mar 2019 08:57:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 38B282F68E for ; Fri, 1 Mar 2019 08:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=cuZu+Sn1KRz0Oh+Jh1SYwJmhlZFmiUWpLBFLmU5JSeI=; b=EoysARl4pz7zCT+x0qzpim/HU/ hEOpnz2V0bndrEC21U8pR9ibCMgFhZURo6wPhLNxDNmg43kURUZcaE5gqOuQjHIZoW4CKF6BRQlGG IQFuR03YzXamVe5S6DIQe3H0oVDht9cVUIjcxx72G0e2nO3dqn9GOint6lCqMXMhB992qbbqF/c7U 2+scX6R7MY+C/fNr0oISH/jiGV1ifNG1OrlX8dV7TjoRoOJpHWoQzE3ekS2MoxoKM4xRfqNKXOq4a VKS7OckEzBb9SmGze3Ig2b6fZ2oRo6ZNxxknrMqwMwpXjM70zsyuT3FuoAi3Qb6rBMNTLjsCLri+c myx3/Zvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdzL-0001Gv-RU; Fri, 01 Mar 2019 08:57:51 +0000 Received: from out1.zte.com.cn ([202.103.147.172] helo=mxct.zte.com.cn) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdyg-0000Mq-7M; Fri, 01 Mar 2019 08:57:16 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id F2CE5393152F0DEE746D; Fri, 1 Mar 2019 16:56:58 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218uqOa086450; Fri, 1 Mar 2019 16:56:52 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116573096-2498916 ; Fri, 1 Mar 2019 16:57:30 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 02/15] ARM: bcm: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:43 +0800 Message-Id: <1551430616-42014-2-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:31, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:56:36, Serialize complete at 2019-03-01 16:56:36 X-MAIL: mse01.zte.com.cn x218uqOa086450 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005710_438830_C084493A X-CRM114-Status: GOOD ( 11.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-bcm/board_bcm281xx.c:43:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 35, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Florian Fainelli --- arch/arm/mach-bcm/board_bcm281xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-bcm/board_bcm281xx.c b/arch/arm/mach-bcm/board_bcm281xx.c index b81bb38..1238ac8 100644 --- a/arch/arm/mach-bcm/board_bcm281xx.c +++ b/arch/arm/mach-bcm/board_bcm281xx.c @@ -38,6 +38,7 @@ static void bcm281xx_restart(enum reboot_mode mode, const char *cmd) return; } base = of_iomap(np_wdog, 0); + of_node_put(np_wdog); if (!base) { pr_emerg("Couldn't map brcm,kona-wdt\n"); return; From patchwork Fri Mar 1 08:56:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A22DC1399 for ; Fri, 1 Mar 2019 08:57:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BE5B2F672 for ; Fri, 1 Mar 2019 08:57:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E8342F6BD; Fri, 1 Mar 2019 08:57:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2F0ED2F672 for ; Fri, 1 Mar 2019 08:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=97to7doXig7VAnK2E3h2dlgNJd0DHXdZA1cOiv0ziYE=; b=sjSqnhuM6/2pJFE/tVYdBFetV1 diop7I6JAfDQBsh4fpd8jiO+1ePPrT4eC7n3JPfm4bEXkKSx/amawWjYm3Uas8923UPGk4cVTLRlr 39VnZgWwDJebG90uMFsNpbVp+VHXlb6GW1udFaBYFODYtnjAWUJnYbrSDYH1Ly42gnmCuLwQABk2R GCudn8PTCRFx+l05LBPftQUn2pbz+tdq9v4/oBlllKI3bz0pX3ryPKs7atJEbQxGYAGN3ovuHjW5i lae5I9mD0xOUh8GnEKAw+UOigg179sVBYfrh2N+03zMl4XM9D5sjLBul59a2ltPZ+bPKIO34SQKym owuZG90A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdyr-0000Zf-Lt; Fri, 01 Mar 2019 08:57:21 +0000 Received: from mxhk.zte.com.cn ([63.217.80.70]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdyf-0000Mz-Vo; Fri, 01 Mar 2019 08:57:12 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id BC2BAED9311404AC15A7; Fri, 1 Mar 2019 16:57:03 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218utNL086492; Fri, 1 Mar 2019 16:56:55 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116573424-2498920 ; Fri, 1 Mar 2019 16:57:34 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 03/15] ARM: exynos: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:44 +0800 Message-Id: <1551430616-42014-3-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:34, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:56:40, Serialize complete at 2019-03-01 16:56:40 X-MAIL: mse01.zte.com.cn x218utNL086492 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005710_175999_873528D7 X-CRM114-Status: GOOD ( 11.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-exynos/firmware.c:201:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 193, but without a corresponding object release within this function. ./arch/arm/mach-exynos/firmware.c:204:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 193, but without a corresponding object release within this function. ./arch/arm/mach-exynos/suspend.c:642:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 634, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Russell King Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-exynos/firmware.c | 1 + arch/arm/mach-exynos/suspend.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index d602e3b..2eaf2db 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c @@ -196,6 +196,7 @@ bool __init exynos_secure_firmware_available(void) return false; addr = of_get_address(nd, 0, NULL, NULL); + of_node_put(nd); if (!addr) { pr_err("%s: No address specified.\n", __func__); return false; diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 0850505..9afb0c6 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -639,8 +639,10 @@ void __init exynos_pm_init(void) if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) { pr_warn("Outdated DT detected, suspend/resume will NOT work\n"); + of_node_put(np); return; } + of_node_put(np); pm_data = (const struct exynos_pm_data *) match->data; From patchwork Fri Mar 1 08:56:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FDDC1399 for ; Fri, 1 Mar 2019 08:57:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B46B2F6E7 for ; Fri, 1 Mar 2019 08:57:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F3172F6E1; Fri, 1 Mar 2019 08:57:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CCA1B2F672 for ; Fri, 1 Mar 2019 08:57:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=n5uRH0DzEOcjaGyOTThJuW3sj/nQQ132+VS/vhikLEI=; b=DzRPDbg5upBipPsuVkzyKj2atf Vmve9iDjzRYsIanX+h3CSueODQvYWXblaunui0mf7jDyLzmUp/XUwIkhL9GV3rwIJCuh7IPSPi8iM u4hBPiy/OtUrPfSovougozqrH9vxL89Zd/FQ7ihjdDrvFmR03hiLsVFutzx0l5ZuvGtxtJL2w7PfM /gnVU6AEFtdeQyW9X2OhTbV/OJcvS+7JFSH36m7qOHMnbirtLdGzcwmd+8zKN8DsYJAMx0xz/D6bI DiG7Yul0sLhwZL5Ma55jASQBOYP5gb/twN1y5hQS3i6PZL3hG/9KhuXCngTe3+VzLr01wWTVQhgtO Zv81Vcyg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdz5-0000uI-8H; Fri, 01 Mar 2019 08:57:35 +0000 Received: from mxhk.zte.com.cn ([63.217.80.70]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdyg-0000OJ-Ul; Fri, 01 Mar 2019 08:57:13 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 0BD96B86D0BDC44FF4DF; Fri, 1 Mar 2019 16:57:09 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218uwJa086664; Fri, 1 Mar 2019 16:56:58 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116573748-2498957 ; Fri, 1 Mar 2019 16:57:37 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 04/15] ARM: hisi: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:45 +0800 Message-Id: <1551430616-42014-4-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:37, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:56:43, Serialize complete at 2019-03-01 16:56:43 X-MAIL: mse01.zte.com.cn x218uwJa086664 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005711_152499_4BC81199 X-CRM114-Status: GOOD ( 14.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-hisi/platsmp.c:74:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 66, but without a corresponding object release within this function. ./arch/arm/mach-hisi/platsmp.c:78:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 66, but without a corresponding object release within this function. ./arch/arm/mach-hisi/platmcpm.c:337:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 275, but without a corresponding object release within this function. ./arch/arm/mach-hisi/platmcpm.c:347:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 275, but without a corresponding object release within this function. ./arch/arm/mach-hisi/platmcpm.c:337:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 284, but without a corresponding object release within this function. ./arch/arm/mach-hisi/platmcpm.c:347:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 284, but without a corresponding object release within this function. ./arch/arm/mach-hisi/platmcpm.c:337:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 287, but without a corresponding object release within this function. ./arch/arm/mach-hisi/platmcpm.c:347:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 287, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Wei Xu Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-hisi/platmcpm.c | 12 ++++++++++-- arch/arm/mach-hisi/platsmp.c | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-hisi/platmcpm.c b/arch/arm/mach-hisi/platmcpm.c index f66815c..695423c 100644 --- a/arch/arm/mach-hisi/platmcpm.c +++ b/arch/arm/mach-hisi/platmcpm.c @@ -277,6 +277,7 @@ static int __init hip04_smp_init(void) goto err; ret = of_property_read_u32_array(np, "boot-method", &hip04_boot_method[0], 4); + of_node_put(np); if (ret) goto err; @@ -285,12 +286,14 @@ static int __init hip04_smp_init(void) if (!np_sctl) goto err; np_fab = of_find_compatible_node(NULL, NULL, "hisilicon,hip04-fabric"); - if (!np_fab) + if (!np_fab) { + of_node_put(np_sctl); goto err; + } ret = memblock_reserve(hip04_boot_method[0], hip04_boot_method[1]); if (ret) - goto err; + goto err_put_node; relocation = ioremap(hip04_boot_method[2], hip04_boot_method[3]); if (!relocation) { @@ -334,6 +337,8 @@ static int __init hip04_smp_init(void) iounmap(relocation); smp_set_ops(&hip04_smp_ops); + of_node_put(np_fab); + of_node_put(np_sctl); return ret; err_table: iounmap(fabric); @@ -343,6 +348,9 @@ static int __init hip04_smp_init(void) iounmap(relocation); err_reloc: memblock_free(hip04_boot_method[0], hip04_boot_method[1]); +err_put_node: + of_node_put(np_fab); + of_node_put(np_sctl); err: return ret; } diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c index da5689a..ecc68fa 100644 --- a/arch/arm/mach-hisi/platsmp.c +++ b/arch/arm/mach-hisi/platsmp.c @@ -71,14 +71,17 @@ static void __init hi3xxx_smp_prepare_cpus(unsigned int max_cpus) ctrl_base = of_iomap(np, 0); if (!ctrl_base) { pr_err("failed to map address\n"); - return; + goto out_put_node; } if (of_property_read_u32(np, "smp-offset", &offset) < 0) { pr_err("failed to find smp-offset property\n"); - return; + goto out_put_node; } ctrl_base += offset; } + +out_put_node: + of_node_put(np); } static int hi3xxx_boot_secondary(unsigned int cpu, struct task_struct *idle) From patchwork Fri Mar 1 08:56:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834789 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3FA41805 for ; Fri, 1 Mar 2019 09:12:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE1332ED47 for ; Fri, 1 Mar 2019 09:12:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1CB32ED53; Fri, 1 Mar 2019 09:12:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7AEAC2ED47 for ; Fri, 1 Mar 2019 09:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=2i5+DzoJAkaaA7JKuryOHgrZ4OsuLZa2EOof09kRF+Q=; b=LbCLjbh9VaP7iOImNd0fSOlVRC vgQJe6blpNVPt76IJp6EQ+96x8deYc686eyBTiZVTh/AM6Ri1l7RfQO4G2kWVmY/8GtcyW08DzU+q wRy6oylFHI6jzC6nu5fqDtFnJxSzCrnIxnL2QyEPz9CUP8Z0mgO9+EjrJB3nOQjNV5XyMC9y/tY/m w4OW2B7m5qoy50PP4cvZ/f7NTQfVkvSsTLOyYvOy7Rbeq+OTbPVkg40j4I38tOtlJzZTcd1DcPfxn xV0RLajZ4io5x05xSfv97FxSgSolukqja0EL98zp0Go2EVKGsen3C82ZvOYJ+u+Qy6A/CnV8/0/pe mptxhZBQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzeDp-0007ty-Mx; Fri, 01 Mar 2019 09:12:49 +0000 Received: from out1.zte.com.cn ([202.103.147.172] helo=mxct.zte.com.cn) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdyk-0000PN-Cc; Fri, 01 Mar 2019 08:57:17 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id EF3AE2ACC4777F4E14F6; Fri, 1 Mar 2019 16:57:12 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218v1Zh086712; Fri, 1 Mar 2019 16:57:01 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116574040-2498968 ; Fri, 1 Mar 2019 16:57:40 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 05/15] ARM: imx51: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:46 +0800 Message-Id: <1551430616-42014-5-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:40, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:56:46, Serialize complete at 2019-03-01 16:56:46 X-MAIL: mse01.zte.com.cn x218v1Zh086712 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005715_408139_672D1932 X-CRM114-Status: GOOD ( 11.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Fabio Estevam , Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de, Lucas Stach MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-imx/mach-imx51.c:64:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 57, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Russell King Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Lucas Stach Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-imx/mach-imx51.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-imx51.c index c7169c2..08c7892 100644 --- a/arch/arm/mach-imx/mach-imx51.c +++ b/arch/arm/mach-imx/mach-imx51.c @@ -59,6 +59,7 @@ static void __init imx51_m4if_setup(void) return; m4if_base = of_iomap(np, 0); + of_node_put(np); if (!m4if_base) { pr_err("Unable to map M4IF registers\n"); return; From patchwork Fri Mar 1 08:56:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20A2917EF for ; Fri, 1 Mar 2019 09:13:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 071312ED53 for ; Fri, 1 Mar 2019 09:13:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEE282ED8B; Fri, 1 Mar 2019 09:13:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7A8B72ED53 for ; Fri, 1 Mar 2019 09:13:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=a05+iou46psn3REXKRdqOqEzy6dFsTMZKd2sLlJZrSE=; b=g+HjZANrmdmMh8BkWgrb1ZQWrR z1CyTlz1utVVI5VxVHA3NMwMrbZ590fOuP9d4aPt7xdW/wfSv8PpSVfz15fY04GzHWpOtItYjYpRx jjGdWqaZMa65ZRGFTC3+2Bml56BalXISuPhnMJJk8K+pU4uD3xxoGbkN7sewBYbF9aL/PZ7465evh W5XG27E5ngE7p85fDHqqWDQFiPh7Cx1S4xdCFE/y/L+Go4jBQsqo5I8i1O5Yl3SUI9+skZyUVfw2+ kI/cwngLxye+AlSBWvWwq3+MM/im1S1TlymiYhQBv5qOt7zql9Ff7PeRgKpq6+r2+Zq4kxFuvfxE5 b8mSC54g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzeE0-0008AC-6W; Fri, 01 Mar 2019 09:13:00 +0000 Received: from out1.zte.com.cn ([202.103.147.172] helo=mxct.zte.com.cn) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdym-0000Rp-Cf; Fri, 01 Mar 2019 08:57:19 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 7924E8CB0EA339EE6CBB; Fri, 1 Mar 2019 16:57:14 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218v4C8086834; Fri, 1 Mar 2019 16:57:04 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116574332-2498980 ; Fri, 1 Mar 2019 16:57:43 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 06/15] arm: npcm: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:47 +0800 Message-Id: <1551430616-42014-6-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:43, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:56:49, Serialize complete at 2019-03-01 16:56:49 X-MAIL: mse01.zte.com.cn x218v4C8086834 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005716_926864_8F3049F6 X-CRM114-Status: GOOD ( 10.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-npcm/platsmp.c:52:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 31, but without a corresponding object release within this function. ./arch/arm/mach-npcm/platsmp.c:68:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 60, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Avi Fishman Cc: Tomer Maimon Cc: Patrick Venture Cc: Nancy Yuen Cc: Brendan Higgins Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: openbmc@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Avi Fishman --- arch/arm/mach-npcm/platsmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c index 21633c7..fe63edc 100644 --- a/arch/arm/mach-npcm/platsmp.c +++ b/arch/arm/mach-npcm/platsmp.c @@ -35,6 +35,7 @@ static int npcm7xx_smp_boot_secondary(unsigned int cpu, goto out; } gcr_base = of_iomap(gcr_np, 0); + of_node_put(gcr_np); if (!gcr_base) { pr_err("could not iomap gcr"); ret = -ENOMEM; @@ -63,6 +64,7 @@ static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus) return; } scu_base = of_iomap(scu_np, 0); + of_node_put(scu_np); if (!scu_base) { pr_err("could not iomap scu"); return; From patchwork Fri Mar 1 08:56:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834777 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 279EB17E9 for ; Fri, 1 Mar 2019 08:58:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0B792F672 for ; Fri, 1 Mar 2019 08:58:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E26132F6BD; Fri, 1 Mar 2019 08:58:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 661822F672 for ; Fri, 1 Mar 2019 08:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=on9G/T/Y/SBEEePBpqCfa+pzp2A85x5v+agrPb+jGLk=; b=pw8I8mhBr9wkx6981gHPDCTitG NH8w6GnrfjutK9iqv4CL7pmbSdU8Zw0mCRIROnYsoVKn4hlsyZUkfNBuXhJm16uuHisFRv6L8xCU0 IeKopk4bCPKY8YNWm8esWbtWhwTGWcuW/CfY2EQVWc340Q1rUcDNL80BG8cN10aJPfo5ZCtjb15TC 9mLbyC5ZndbLSiMwxqLaY4XPoBk5DfoTTERsOppKVWlcxKQtAt+8ZuTvAKHcZCfWNW1Pihxh8P4Sa 6ipCyT3e8XXWqc7+O/eUxtRKTqJ9UdQABfhRQpiFbN1yO1yEkiI7MQjEa4mYe9ntxH4U+HbWIBT3u UVrbGZWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gze0H-0002ep-83; Fri, 01 Mar 2019 08:58:49 +0000 Received: from out1.zte.com.cn ([202.103.147.172] helo=mxct.zte.com.cn) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdzK-0001C8-Cz; Fri, 01 Mar 2019 08:58:23 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id CC1E3FB4494B3BFFA1CA; Fri, 1 Mar 2019 16:57:16 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218v7wO086910; Fri, 1 Mar 2019 16:57:07 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116574621-2498999 ; Fri, 1 Mar 2019 16:57:46 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 07/15] ARM: rockchip: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:48 +0800 Message-Id: <1551430616-42014-7-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:46, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:56:52, Serialize complete at 2019-03-01 16:56:52 X-MAIL: mse01.zte.com.cn x218v7wO086910 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005751_059881_3F75DEAF X-CRM114-Status: GOOD ( 15.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-rockchip/pm.c:269:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 259, but without a corresponding object release within this function. ./arch/arm/mach-rockchip/pm.c:275:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 259, but without a corresponding object release within this function ./arch/arm/mach-rockchip/platsmp.c:280:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 271, but without a corresponding object release within this function. ./arch/arm/mach-rockchip/platsmp.c:284:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 271, but without a corresponding object release within this function. ./arch/arm/mach-rockchip/platsmp.c:288:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 271, but without a corresponding object release within this function. ./arch/arm/mach-rockchip/platsmp.c:302:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 293, but without a corresponding object release within this function. ./arch/arm/mach-rockchip/platsmp.c:250:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function. ./arch/arm/mach-rockchip/platsmp.c:260:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function. ./arch/arm/mach-rockchip/platsmp.c:263:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Russell King Cc: Heiko Stuebner Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-rockchip/platsmp.c | 12 ++++++++---- arch/arm/mach-rockchip/pm.c | 11 ++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c index 51984a4..f93d64e 100644 --- a/arch/arm/mach-rockchip/platsmp.c +++ b/arch/arm/mach-rockchip/platsmp.c @@ -277,19 +277,20 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) sram_base_addr = of_iomap(node, 0); if (!sram_base_addr) { pr_err("%s: could not map sram registers\n", __func__); - return; + goto out_put_node; } if (has_pmu && rockchip_smp_prepare_pmu()) - return; + goto out_put_node; if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) { if (rockchip_smp_prepare_sram(node)) - return; + goto out_put_node; /* enable the SCU power domain */ pmu_set_power_domain(PMU_PWRDN_SCU, true); + of_node_put(node); node = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); if (!node) { pr_err("%s: missing scu\n", __func__); @@ -299,7 +300,7 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) scu_base_addr = of_iomap(node, 0); if (!scu_base_addr) { pr_err("%s: could not map scu registers\n", __func__); - return; + goto out_put_node; } /* @@ -321,6 +322,9 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) /* Make sure that all cores except the first are really off */ for (i = 1; i < ncores; i++) pmu_set_power_domain(0 + i, false); + +out_put_node: + of_node_put(node); } static void __init rk3036_smp_prepare_cpus(unsigned int max_cpus) diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c index 0592534..43a16c9 100644 --- a/arch/arm/mach-rockchip/pm.c +++ b/arch/arm/mach-rockchip/pm.c @@ -266,25 +266,26 @@ static int rk3288_suspend_init(struct device_node *np) rk3288_bootram_base = of_iomap(sram_np, 0); if (!rk3288_bootram_base) { pr_err("%s: could not map bootram base\n", __func__); - return -ENOMEM; + ret = -ENOMEM; + goto out_put_node; } ret = of_address_to_resource(sram_np, 0, &res); if (ret) { pr_err("%s: could not get bootram phy addr\n", __func__); - return ret; + goto out_put_node; } rk3288_bootram_phy = res.start; - of_node_put(sram_np); - rk3288_config_bootdata(); /* copy resume code and data to bootsram */ memcpy(rk3288_bootram_base, rockchip_slp_cpu_resume, rk3288_bootram_sz); - return 0; +out_put_node: + of_node_put(sram_np); + return ret; } static const struct platform_suspend_ops rk3288_suspend_ops = { From patchwork Fri Mar 1 08:56:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2CD071805 for ; Fri, 1 Mar 2019 09:13:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17AF52ED53 for ; Fri, 1 Mar 2019 09:13:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B0152ED8B; Fri, 1 Mar 2019 09:13:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A281C2ED53 for ; Fri, 1 Mar 2019 09:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VgkfxqmHRMhaYisP4sNkpRCgDl0F2qPY5nInytbA5E8=; b=rwhUXEtdPaVDsjNvke2CMEc4s6 CJD924xFNEJy56IifhUsd+NIAiWMADAIjJ91Q1Pj5fwbxnUMrDG6PbYtgIQX8WkoJESBnc//FkVRb 3AjgdAUxy6zYim7VeWrnYheCWceq6STZcjuSpng19dPWd7hVD00T1v29jy60WKnr/4lXQJQQOJPHC 7u6feYApNDjEyfj2YpOfjSRijb0OcYb5sA6p3XLBqd+9CirXgGEJ9bZ447uhjRBJf1XgMHohlJVNo N7SfFOmJV96gQLQ+ew5CftgogIZkrddJyCjzCNE3IAZLtCq7LxgWSfJfyUvnC6kuFHJ8i7vd7zzNL htZqOJvQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzeE7-0008LV-F8; Fri, 01 Mar 2019 09:13:07 +0000 Received: from mxhk.zte.com.cn ([63.217.80.70]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdyq-0000Xs-Bo; Fri, 01 Mar 2019 08:57:24 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id CB400993C0240A279B7F; Fri, 1 Mar 2019 16:57:18 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218v9oQ086997; Fri, 1 Mar 2019 16:57:09 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116574884-2499005 ; Fri, 1 Mar 2019 16:57:48 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 08/15] ARM: shmobile: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:49 +0800 Message-Id: <1551430616-42014-8-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:48, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:56:54, Serialize complete at 2019-03-01 16:56:54 X-MAIL: mse01.zte.com.cn x218v9oQ086997 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005721_122184_DEFF887D X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-shmobile/pm-rcar-gen2.c:77:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 66, but without a corresponding object release within this function. ./arch/arm/mach-shmobile/pm-rcar-gen2.c:85:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 66, but without a corresponding object release within this function. ./arch/arm/mach-shmobile/pm-rcar-gen2.c:90:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 66, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Simon Horman Cc: Magnus Damm Cc: Russell King Cc: linux-renesas-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Geert Uytterhoeven --- arch/arm/mach-shmobile/pm-rcar-gen2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c index 8c2a205..e84599d 100644 --- a/arch/arm/mach-shmobile/pm-rcar-gen2.c +++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c @@ -72,6 +72,7 @@ void __init rcar_gen2_pm_init(void) } error = of_address_to_resource(np, 0, &res); + of_node_put(np); if (error) { pr_err("Failed to get smp-sram address: %d\n", error); return; From patchwork Fri Mar 1 08:56:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834799 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBE8217EF for ; Fri, 1 Mar 2019 09:13:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7F872ED53 for ; Fri, 1 Mar 2019 09:13:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B0A32ED8B; Fri, 1 Mar 2019 09:13:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 07C122ED53 for ; Fri, 1 Mar 2019 09:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=nz56/F6T3PkepVLQF6YHHRwSTDqjKKiQW1wbgcPnvL4=; b=uRCEvWugerYrVMdBtv83QjV+ez K8UYlhJjK1O6BjsKb+WxMRRmrLp4H8UBNrp43CCEdyr8/Dn0E5WwbVn3qHjqsbWxXLGzk+3FK8t6c 07R3zuJXZu8m2pivl/2YVYoK0KBqNVf4UlNhlOjQSGUygHLWGet97tmDOsRDedJmR4p8b4Kg9H1cl MQSQ6KlhA3al4kbd64pXomHYw0eCG17w8if9ppY038Yc9oTeHROLH6eSNQgbt0cAY3J+1kP6hv03N ZiO8dx3nWZOFNf1XdDO0cE5TteuqnM2bmD+ui6z0MeUNX8FuUPHshhtSeDniONxdP6+z2fb87JqUP g7B/c8Fg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzeEJ-0000B4-9q; Fri, 01 Mar 2019 09:13:19 +0000 Received: from out1.zte.com.cn ([202.103.147.172] helo=mxct.zte.com.cn) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdyv-0000fd-UM; Fri, 01 Mar 2019 08:57:31 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 15771E684883FDA264E8; Fri, 1 Mar 2019 16:57:24 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218vEeK087103; Fri, 1 Mar 2019 16:57:14 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116575305-2499021 ; Fri, 1 Mar 2019 16:57:53 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 09/15] ARM: socfpga: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:50 +0800 Message-Id: <1551430616-42014-9-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:53, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:56:58, Serialize complete at 2019-03-01 16:56:58 X-MAIL: mse01.zte.com.cn x218vEeK087103 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005726_959701_2FD9DD18 X-CRM114-Status: GOOD ( 11.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-socfpga/platsmp.c:93:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 85, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Dinh Nguyen Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-socfpga/platsmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c index 0ee7677..55c2884 100644 --- a/arch/arm/mach-socfpga/platsmp.c +++ b/arch/arm/mach-socfpga/platsmp.c @@ -89,6 +89,7 @@ static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus) } socfpga_scu_base_addr = of_iomap(np, 0); + of_node_put(np); if (!socfpga_scu_base_addr) return; scu_enable(socfpga_scu_base_addr); From patchwork Fri Mar 1 08:56:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834781 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 44AD517EF for ; Fri, 1 Mar 2019 09:04:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 227112EC38 for ; Fri, 1 Mar 2019 09:04:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1082B2EC4C; Fri, 1 Mar 2019 09:04:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A75E22EC38 for ; Fri, 1 Mar 2019 09:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=cnxWxuNCsiia0Pd/ckNgTmWtsJKAU+xYpj/cUAjZqs4=; b=BVWfMiGeWatRFtAo6iZvmE1rl2 QdiNkP6t3avCCHgNAnUfaQdnyqmK74AqqrWevRRxGOjyI7E8xpYHbu/TpKDjcNOM9zKhcQ0AH8Fws RwV+VzICn8hbncpby+KsX2diVY/KVUHGVQ5kI+S+7wyLHvzqcNo5im/4rQbgUd7buuJVIRaUMS9O9 Ntqh7oOj8flf41N5oWFw61vAO8CKgNrjZ6j+a+iakqOluDQzRn6JWgAaWFsHBhteW7pm5Ae5oMDEx CByyhp2QzGikT43m2REHGQNITJke5jhkdR//JHTMn+8+j3bBLcP9rsSzJI2udiAEil6iKmLc/dJVq moxZcpDg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gze5j-0004aH-SX; Fri, 01 Mar 2019 09:04:27 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gze5h-0004Xn-Pv; Fri, 01 Mar 2019 09:04:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=G7U2lApkl358j+w+vR7wrgG1OKX0aSMfb/qlqA2v3Ic=; b=jjXTsBbZmh6cJftLh/QLLSJqj 6biK5fMDRG/ttWUmcvgVEBBSSQkLNz8KkWYjwQoIQVr0J+G6v6BjfupWzPXRnsW5xNarboJ1va0GR mnJZvjc9DwAgQ5IG0Vsp1ESB0SO7oacf3tpBgA82L0FP2ljmI2+vK+7YgD5RPlvBz27jJ/pOmNCaH q3QhPV0Tdf5LcuVFZKf98DS9AXeA4K6AWILOnVNdSIbuAY74krvMx2TdkE1uJYCStOMCvryficcOv wOyhQd7brRYCj6oOSPDLKpwGevb6JPtbXdBLTbUht6hLsme5EZJlyMplmq1Ee4iLBLmmpD8IB5yEZ aztnN9WOQ==; Received: from [202.103.147.172] (helo=mxct.zte.com.cn) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdzi-00008D-Fg; Fri, 01 Mar 2019 08:58:16 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id D47FC45984B79C16E70C; Fri, 1 Mar 2019 16:57:28 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218vHe7087152; Fri, 1 Mar 2019 16:57:17 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116575609-2499040 ; Fri, 1 Mar 2019 16:57:56 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 10/15] ARM: sunxi: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:51 +0800 Message-Id: <1551430616-42014-10-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:56, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:57:01, Serialize complete at 2019-03-01 16:57:01 X-MAIL: mse01.zte.com.cn x218vHe7087152 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_085814_883733_1E00919F X-CRM114-Status: GOOD ( 10.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-sunxi/platsmp.c:55:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 46, but without a corresponding object release within this function. ./arch/arm/mach-sunxi/platsmp.c:138:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 129, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-sunxi/platsmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-sunxi/platsmp.c b/arch/arm/mach-sunxi/platsmp.c index 8fb5088..c842209 100644 --- a/arch/arm/mach-sunxi/platsmp.c +++ b/arch/arm/mach-sunxi/platsmp.c @@ -50,6 +50,7 @@ static void __init sun6i_smp_prepare_cpus(unsigned int max_cpus) } prcm_membase = of_iomap(node, 0); + of_node_put(node); if (!prcm_membase) { pr_err("Couldn't map A31 PRCM registers\n"); return; @@ -63,6 +64,7 @@ static void __init sun6i_smp_prepare_cpus(unsigned int max_cpus) } cpucfg_membase = of_iomap(node, 0); + of_node_put(node); if (!cpucfg_membase) pr_err("Couldn't map A31 CPU config registers\n"); From patchwork Fri Mar 1 08:56:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834803 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6505E1805 for ; Fri, 1 Mar 2019 09:13:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 501D32ED5F for ; Fri, 1 Mar 2019 09:13:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40BE82ED8B; Fri, 1 Mar 2019 09:13:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C8ADB2ED5F for ; Fri, 1 Mar 2019 09:13:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=gcAbOu/Ai0dwdStWJDNuvCnChfmOrwYWvJnn2PYmpqI=; b=akBlLvp2o6jsX9JPyEnoa++PfO zQ6SvsXF5wLS1YTUuG2HMKlL4b/HrKTsllt7O5XhOym72SGd+S7Y2Okgq/pXzx/3XuEGnsFwkDEBn jW7XIJfEK5t/EWkWwgHQggN4ci3H3Bzd9zaLbkyDb/YKb012nEO3QtlucMOMklHajVqQ8EXCH+Lbo jlUbbWLABTQqBJ4KTPaVTeqQ8RdPSMeGrjq8L+8vA2KVoC5drP2xAejz0Wsdw0DbdhJ/X1K7nXNNH tzpxK0VTfVf9Z7aJaJpOOL6nfhzEhPvQJ3jLvCvB76O5lexxNSAEBhfiJCVc0d+heG/9SII0bfLTT SMnDDQfg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzeEU-0000S8-Tc; Fri, 01 Mar 2019 09:13:30 +0000 Received: from out1.zte.com.cn ([202.103.147.172] helo=mxct.zte.com.cn) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdz3-0000r5-Dw; Fri, 01 Mar 2019 08:57:47 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 0048A6929E0059AF8023; Fri, 1 Mar 2019 16:57:31 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218vKSM087213; Fri, 1 Mar 2019 16:57:20 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116575888-2499047 ; Fri, 1 Mar 2019 16:57:58 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 11/15] ARM: versatile: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:52 +0800 Message-Id: <1551430616-42014-11-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:57:58, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:57:04, Serialize complete at 2019-03-01 16:57:04 X-MAIL: mse01.zte.com.cn x218vKSM087213 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005734_134362_36B2E11E X-CRM114-Status: GOOD ( 12.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-versatile/versatile_dt.c:315:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 302, but without a corresponding object release within this function. ./arch/arm/mach-versatile/versatile_dt.c:320:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 302, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Linus Walleij Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-versatile/versatile_dt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c index e9d6068..028463a 100644 --- a/arch/arm/mach-versatile/versatile_dt.c +++ b/arch/arm/mach-versatile/versatile_dt.c @@ -312,12 +312,12 @@ static void __init versatile_dt_pci_init(void) * driver had it so we will keep it. */ writel(1, versatile_sys_base + VERSATILE_SYS_PCICTL_OFFSET); - return; + goto out_put_node; } newprop = kzalloc(sizeof(*newprop), GFP_KERNEL); if (!newprop) - return; + goto out_put_node; newprop->name = kstrdup("status", GFP_KERNEL); newprop->value = kstrdup("disabled", GFP_KERNEL); @@ -325,6 +325,9 @@ static void __init versatile_dt_pci_init(void) of_update_property(np, newprop); pr_info("Not plugged into PCI backplane!\n"); + +out_put_node: + of_node_put(np); } static void __init versatile_dt_init(void) From patchwork Fri Mar 1 08:56:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834915 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C4461515 for ; Fri, 1 Mar 2019 10:11:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA20B2DF58 for ; Fri, 1 Mar 2019 10:11:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD0F92DF62; Fri, 1 Mar 2019 10:11:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 716A02DF58 for ; Fri, 1 Mar 2019 10:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YyK+nXx+SCruCpW7WjZUBB+iBNv6U2B9Z8cEUp8DR5E=; b=E7zNxb0fZSP/5rfFuhRSujtxnU ntSoIsQ5hYk2kYymQEI0CPn3n75F+HtikmtBrsj30ZA7MLA7r5XpDo7yZA2U10afim3gQJvxopgMt ePu4wdMM8CqiOwrcEFzlIurtXDsYRQZ8mGGEOhUz1RTJuOdED5qOLJzLqk1AtYcCrn+SVlWn+EU/B YuejncOD4ITF4wQd7LqxpOtQ6gjXDwOOdZGNSEgQjUf3yghG34ejB83eRRgNZ/drQ3EtEzvqLmPqM KK12pOkCG1Bc7gFOQaTxRde/hLSFMS7SBPOQgXIEOPb0CeXHkNmeL5bZ42XKXXooNh7/ux6e6efpO SMi+5BoQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzf8H-0006C1-QO; Fri, 01 Mar 2019 10:11:09 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzf7w-0005f8-5V; Fri, 01 Mar 2019 10:10:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=b2bffNjXshsgXMJ5WLTLq/IL72wG4KpVnf2G9A/iMGQ=; b=pHJPHIVFFdizqJovA3BkuLJCu r01vSK4VesII5ucPd8Jssyl+ICFim139GylMQj/Mxfii7kAMsn4K64L+X70EQn+8/3mBE/tEpC8Ci xOk4i2UdunEQqChGgqspcj/tSa7XyErsiuEtWYayg/5joXEUfscnbvooVljoV4b7nw4LJEk0V+S0u eNavGoJG70VRrQHBqBX3qUBIfNBZ4B0v77lFrgEAqM8gj2Cywx+Jrb52eQuslQMph1GkJLRFxQ3ye gorYxYcCO7hCP14v3LUYZuguvqX5OfoaM/68hpsmjBDhy6Yb9V2NfXFn9rF5fMbRXcI1X7DoBCzH+ hFRh4QwVg==; Received: from out1.zte.com.cn ([202.103.147.172] helo=mxct.zte.com.cn) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdzb-000615-OI; Fri, 01 Mar 2019 08:58:08 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 031C5A193DAC80C7A1AD; Fri, 1 Mar 2019 16:57:34 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218vMM0087267; Fri, 1 Mar 2019 16:57:22 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116580173-2499064 ; Fri, 1 Mar 2019 16:58:01 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 12/15] ARM: vexpress: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:53 +0800 Message-Id: <1551430616-42014-12-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:58:01, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:57:07, Serialize complete at 2019-03-01 16:57:07 X-MAIL: mse01.zte.com.cn x218vMM0087267 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_035808_036837_58DF33F0 X-CRM114-Status: GOOD ( 11.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-vexpress/dcscb.c:150:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 145, but without a corresponding object release within this function. ./arch/arm/mach-vexpress/dcscb.c:160:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 145, but without a corresponding object release within this function. ./arch/arm/mach-vexpress/dcscb.c:171:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 145, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Acked-by: Sudeep Holla --- arch/arm/mach-vexpress/dcscb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c index ee2a0fa..aaade91 100644 --- a/arch/arm/mach-vexpress/dcscb.c +++ b/arch/arm/mach-vexpress/dcscb.c @@ -146,6 +146,7 @@ static int __init dcscb_init(void) if (!node) return -ENODEV; dcscb_base = of_iomap(node, 0); + of_node_put(node); if (!dcscb_base) return -EADDRNOTAVAIL; cfg = readl_relaxed(dcscb_base + DCS_CFG_R); From patchwork Fri Mar 1 08:56:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C74351669 for ; Fri, 1 Mar 2019 10:10:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B18012DF58 for ; Fri, 1 Mar 2019 10:10:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4D8B2DF5B; Fri, 1 Mar 2019 10:10:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4E9532DF58 for ; Fri, 1 Mar 2019 10:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=K9tp653sx2Bgp6eZ9XB7nab/acdWmKRxuQ9FCiloT2o=; b=c//tAWsNizLMPC5mqZd6W+aEGo VmP5u+a66rh1UAClv4GEUu2OsmJsjmxvLRaRU9xMcH/ZtPMnFr/77zI0a17ZgwFSNdIwPInOUpskq /IaZ2AlclAgiw0+ndq98XahVNX4NEEuMmFzJuB2gYBQb3VAFKuBUuNXZaMwrYEoms0wxMmPz1rx5f zDgWJUSdI+MyoIs3paFI2nYpyxReauY/nHYWQRdnJf3nG6tMH3OrgWhh6oy7RC/73wUiuZ0IZ5OvD UIWSSVwaOMrp5F2jqULu6jZ2QqRcyD0tVPW13DH0BYfMohMpVapqNi0mTMkSMuOhHpBonTDkKHVrE MAqfMJWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzf81-0005nb-V8; Fri, 01 Mar 2019 10:10:53 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzf7u-0005f8-Lg; Fri, 01 Mar 2019 10:10:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=esD6Cde4xWxgNYVmylxWzk9ARqTCIwQO8AQYeEhNbgU=; b=nq15DesP78CbssCYCZ9Q7KlR/ m7e8j6K3+UglX9642F0WQPNjbTclP8akyfpRQqjgYZuALpgRF/f6RefzlO9snEsr2/Fsl/6WMJ6zw U9zT3lc+MSiYgWGAHb83Ys7V3YLHYma+V/UVOEhznUtKmUP9sisO/fEBVFiN/xnwbvQcGtUi8pb/e w3Ieaw2yCMJkw5rohTbguwSjHbazl95qQedxsL8YKQFFUKjgU4+L7fp5r7Jr4TElquSAWwsu1B1um Qo2S/3ecgXRTHc5tyOIbFdwDcgtJkPDbepuMcjs+YgITezv9YkzpF/nxbrSarXaj7uEenGR+uHiBg zk0Gac2iw==; Received: from out1.zte.com.cn ([202.103.147.172] helo=mxct.zte.com.cn) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdza-00060a-OT; Fri, 01 Mar 2019 08:58:07 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id C901A83C311E510B0053; Fri, 1 Mar 2019 16:57:38 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218vPvD087309; Fri, 1 Mar 2019 16:57:25 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116580410-2499072 ; Fri, 1 Mar 2019 16:58:04 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 13/15] ARM: zynq: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:54 +0800 Message-Id: <1551430616-42014-13-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:58:04, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:57:09, Serialize complete at 2019-03-01 16:57:09 X-MAIL: mse01.zte.com.cn x218vPvD087309 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_035807_087501_8DFBB8DC X-CRM114-Status: GOOD ( 12.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-zynq/common.c:89:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 80, but without a corresponding object release within this function. ./arch/arm/mach-zynq/common.c:98:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 80, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Russell King Cc: Michal Simek Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-zynq/common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 6aba9eb..a8b1b9c 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c @@ -84,6 +84,7 @@ static int __init zynq_get_revision(void) } zynq_devcfg_base = of_iomap(np, 0); + of_node_put(np); if (!zynq_devcfg_base) { pr_err("%s: Unable to map I/O memory\n", __func__); return -1; From patchwork Fri Mar 1 08:56:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29F731515 for ; Fri, 1 Mar 2019 10:10:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 134CD2DF58 for ; Fri, 1 Mar 2019 10:10:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 058E42DF5B; Fri, 1 Mar 2019 10:10:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EF0B72DF58 for ; Fri, 1 Mar 2019 10:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=6Aw5C4MFVoZdUz0QfR/xt7FA5RdTUspvIYSmuc+a2/I=; b=dXyZ1GYMZiQzmgeFzxEzBWDAqS fgSpxI1l3j6BifXeRmZpVAEXcimm+TGga05G5qomm6NFT3zhJfLmiUjYygD75kuDsjCF2+yCBjRNy 6sc32iyNjd+wl5Vq+dl0nWQu6shmnwFTOyRLnmuHSCRpHLkpp32d15l9+HWr3PPMUjSr0qhgYCfYr v/qEg5fTKAwcp4jdYdts3ZhnNfTEhXLLhKmH8mCZLXlSonqEB5+uiyCk0x9aNJ5AH2JHyVTBs211L 7aqvGle7jcoT4B1fTa7TQIyfClt/gC3mZueqtH1sbjcwCdrjT/4FrGy2IOd1Baijj2NdqEuLWytLK sqQ/fj0w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzf7v-0005fQ-38; Fri, 01 Mar 2019 10:10:47 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzf7t-0005f8-70; Fri, 01 Mar 2019 10:10:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2CnmYh3qMP9rhBSuGrIbdLA3/5opb9CKG236mUT2uKk=; b=JRWzbFrB0IUDBYZmUyVNqWTtm JIUgek9g6pWNIN9gSyXcxvSg4n1EU1WjfWyLF7Byrc5TcV8K0CdeNwFepH8ZjN04FO/pPuZfYYU4M qjNKKm3rkYB/M7OI7TNqP+i89VuoesHePBZGOOV6cE2JR9fmAeDBVBNNWaGN0YsoSwJ94sghkeH9I 2duPN8OmG8mLbBWIh6vuDKaew+kVQNZEKRAE/l/9g+/9DOQjO/iyOo4kAILoLFdGaDAshtJg/3I5M rkuh0r0bM9gkNb9MLHV0VoQ+hgQA/tQWChZVsZDa29CSXfBZmLoOi4IGIbRmSJyPuB4oqyAexrZc+ Ef+Jvxrkw==; Received: from out1.zte.com.cn ([202.103.147.172] helo=mxct.zte.com.cn) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdzg-00062T-Qt; Fri, 01 Mar 2019 08:58:14 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 47EEFEA8356A865F93A0; Fri, 1 Mar 2019 16:57:40 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218vRpU087389; Fri, 1 Mar 2019 16:57:27 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116580665-2499079 ; Fri, 1 Mar 2019 16:58:06 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 14/15] arm64: cpu_ops: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:55 +0800 Message-Id: <1551430616-42014-14-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:58:06, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:57:12, Serialize complete at 2019-03-01 16:57:12 X-MAIL: mse01.zte.com.cn x218vRpU087389 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_035813_145985_E497C3A8 X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm64/kernel/cpu_ops.c:102:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 69, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm64/kernel/cpu_ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/cpu_ops.c b/arch/arm64/kernel/cpu_ops.c index ea00124..00f8b86 100644 --- a/arch/arm64/kernel/cpu_ops.c +++ b/arch/arm64/kernel/cpu_ops.c @@ -85,6 +85,7 @@ static const char *__init cpu_read_enable_method(int cpu) pr_err("%pOF: missing enable-method property\n", dn); } + of_node_put(dn); } else { enable_method = acpi_get_enable_method(cpu); if (!enable_method) { From patchwork Fri Mar 1 08:56:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Yang X-Patchwork-Id: 10834773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F2861399 for ; Fri, 1 Mar 2019 08:58:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79D622F672 for ; Fri, 1 Mar 2019 08:58:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CBAB2F6BD; Fri, 1 Mar 2019 08:58:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EFB3F2F672 for ; Fri, 1 Mar 2019 08:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Dmi5yzM6YBKP5TliMEnllhvPx3mhZzV12k/WTqjM4vg=; b=iRjMuef6X/c482S5DRDYFf9i7e x9L/7wJgmIZQb/DG01YvE0PmswQv9xCVBYCUYsISFIjvpyyMyrWfWVqr6/mM7yoWnDLYJu1hBLklA +5lLXcTRux+avye6OYKhf5Uny0AN9LskfYsZKkdb3jx4ZuRiqXTdkZjJ1iEixMgFuaX3xubNSZhsh F0eySx/ieELw6dg/TQIHI7cD3mYM4YtwNszrOrPwhXJP+KYC9qP85pMGPDfV7yS43QGIIRMlQcHug JVCV0yTq7NOnXuHXzOM3n2nPcPzzOZ07saTelFhn+dAh/RWubnbSF83qvbSDQdQTeY6d0w8sCDFf/ GOkIF+lg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gze06-0002S0-B2; Fri, 01 Mar 2019 08:58:38 +0000 Received: from mxhk.zte.com.cn ([63.217.80.70]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzdzE-000148-1r; Fri, 01 Mar 2019 08:57:58 +0000 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id C29D6D8B7D8DE248F00F; Fri, 1 Mar 2019 16:57:41 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x218vUSR087466; Fri, 1 Mar 2019 16:57:30 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019030116580955-2499096 ; Fri, 1 Mar 2019 16:58:09 +0800 From: Wen Yang To: liviu.dudau@arm.com Subject: [PATCH 15/15] ARM: axxia: fix a leaked reference by addingmissing of_node_put Date: Fri, 1 Mar 2019 16:56:56 +0800 Message-Id: <1551430616-42014-15-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> References: <1551430616-42014-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-01 16:58:09, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-01 16:57:15, Serialize complete at 2019-03-01 16:57:15 X-MAIL: mse01.zte.com.cn x218vUSR087466 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190301_005744_874797_4EDFF925 X-CRM114-Status: GOOD ( 11.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko@sntech.de, maxime.ripard@bootlin.com, catalin.marinas@arm.com, linus.walleij@linaro.org, brendanhiggins@google.com, michal.simek@xilinx.com, xuwei5@hisilicon.com, manivannan.sadhasivam@linaro.org, Wen Yang , tmaimon77@gmail.com, f.fainelli@gmail.com, linux-rockchip@lists.infradead.org, will.deacon@arm.com, openbmc@lists.ozlabs.org, magnus.damm@gmail.com, linux@armlinux.org.uk, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, wens@csie.org, kgene@kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, rjui@broadcom.com, s.hauer@pengutronix.de, lorenzo.pieralisi@arm.com, yuenn@google.com, linux-arm-kernel@lists.infradead.org, sbranden@broadcom.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, dinguyen@kernel.org, horms@verge.net.au, kernel@pengutronix.de, sudeep.holla@arm.com, fabio.estevam@nxp.com, shawnguo@kernel.org, afaerber@suse.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./arch/arm/mach-axxia/platsmp.c:46:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 40, but without a corresponding object release within this function. ./arch/arm/mach-axxia/platsmp.c:53:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 40, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- arch/arm/mach-axxia/platsmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c index 502e3df..c706a11 100644 --- a/arch/arm/mach-axxia/platsmp.c +++ b/arch/arm/mach-axxia/platsmp.c @@ -42,6 +42,7 @@ static int axxia_boot_secondary(unsigned int cpu, struct task_struct *idle) return -ENOENT; syscon = of_iomap(syscon_np, 0); + of_node_put(syscon_np); if (!syscon) return -ENOMEM;