Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp308994imb; Fri, 1 Mar 2019 00:58:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxW79UhvFVAgtKPWnC3SXxqlhtVyK3NRzTTb2NwdoumBLleZBHGmge43mqE/nJMHqX850ni X-Received: by 2002:a63:ec48:: with SMTP id r8mr3829517pgj.50.1551430690260; Fri, 01 Mar 2019 00:58:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551430690; cv=none; d=google.com; s=arc-20160816; b=SznXu3XKdssuxr8h7l3UHBG3xA2qDq12wkR1H4p/ar4eIDdQ7HDudg8YZdpit1fEIZ GxoiQeFr9cvOSbZsbXeO0GCYCOKJGc7bB/rwzaqcU2mz7p68NaydRyOUbNk2QX8aBggi vFtCbxHxhOK6S4JzPXscQc0o0nulorN/GM4pwYkLs5/t698gTs1zjEClx/r5AGzAjTme ByWyWU9Dqf1G1Vei9bmcM0arPmy1S6rqEH8TDq0XoKmxpfxZTGNKGlNccufrCbAlK3Op fmCHAE4yzPaDnZ7MUSqGY0dxqxN6w9t/ztsTJG3sBhCINEiLNop396CUtcP4SFYXmX4f h96A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=U1d1TyS/TI3UtAzEgW7Gninsfwn89qf6jjq9vqzjQrw=; b=v2zimrrLDJYe/1Pwr37uX1dMoPSM2FyPYOOkuwbYivPbTFHxCgN5K25MPwsVbWZW7J mqfHbCovS7aBPR7ixc9JT/eDq7z8XuzpOF1nr9pHiWV8u3iJm64Jlrm6z/5arR4JOzbh xhpUEP3+yG6Ymcz2jWKQbV3+jyKZ5/3KjlQdVGZjBw/0pR9GV1K99eUweGAh9OBk48+e eXF+ur9mpwestl0/xpf0SUIgQUpfahj4ZpIiKgsSFfDvEEiAZAd3/Vwey6zvKTWuSTHK YiHinRfCY+0DtkfA3743ntYajROf7zQRMmZ6nc+um9XpKy5sJtXM5VgrSsUu+HL+L8+V 5MfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f30si7478831pgf.208.2019.03.01.00.57.55; Fri, 01 Mar 2019 00:58:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387559AbfCAI5X (ORCPT + 99 others); Fri, 1 Mar 2019 03:57:23 -0500 Received: from mxhk.zte.com.cn ([63.217.80.70]:18748 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387525AbfCAI5V (ORCPT ); Fri, 1 Mar 2019 03:57:21 -0500 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 Cc: sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kgene@kernel.org, krzk@kernel.org, linux-samsung-soc@vger.kernel.org, michal.simek@xilinx.com, afaerber@suse.de, manivannan.sadhasivam@linaro.org, dinguyen@kernel.org, heiko@sntech.de, linux-rockchip@lists.infradead.org, f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linus.walleij@linaro.org, avifishman70@gmail.com, tmaimon77@gmail.com, venture@google.com, yuenn@google.com, brendanhiggins@google.com, openbmc@lists.ozlabs.org, xuwei5@hisilicon.com, maxime.ripard@bootlin.com, wens@csie.org, catalin.marinas@arm.com, will.deacon@arm.com, horms@verge.net.au, magnus.damm@gmail.com, linux-renesas-soc@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, fabio.estevam@nxp.com, linux-imx@nxp.com, wang.yi59@zte.com.cn, Wen Yang 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.9.5