From patchwork Fri Jun 15 12:28:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 10466319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0F2F600F4 for ; Fri, 15 Jun 2018 12:30:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E70D528D8B for ; Fri, 15 Jun 2018 12:30:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB5E428D8F; Fri, 15 Jun 2018 12:30:10 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 B8DDF28D8B for ; Fri, 15 Jun 2018 12:30:09 +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: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=WJtOqP6dyuyy79lpKZ3YnAr9td/CmWvWof8dYadmHZY=; b=EAL up+yJBdbn/J2IXgVZr6ZbxnMfcvyFfWn4KF9IgV6u3JdciZwQ6v73LBX8ADZrdn4DMo2kcKhvWgq9 +h17MGyeksTJQjjDiVcLHiuxkdVOzUf5YXRp6yxeDodVHfnTZ+2OMT0ZVm0P0GFF4cVXK/RsV3lTy XqYWgQs1VyRV+bvTCHtlGP0opWGGdOhoeKvjaC5/Dy8C4zppxe76HDoMxkkAVaIguSNXY9oKRDh5V KTWRVeL4VNGSeAeT3EAAiTyzA6FPW0tqDffR+ldDzeRXA9shuuv93ux2Fs375Rm3fphuvlfpS/LhX 1bL3hyD4MTrzgvqnHkAPG9SXdbjUYCg==; 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 1fTnrb-0006id-LR; Fri, 15 Jun 2018 12:29:59 +0000 Received: from www.osadl.org ([2001:a60:9266:ffff:62:245:132:105]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTnrX-0006gi-V2 for linux-arm-kernel@lists.infradead.org; Fri, 15 Jun 2018 12:29:57 +0000 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id w5FCSOgB008437; Fri, 15 Jun 2018 14:28:24 +0200 From: Nicholas Mc Guire To: Anders Berg Subject: [PATCH] ARM: add missing of_node_put() Date: Fri, 15 Jun 2018 14:28:08 +0200 Message-Id: <1529065688-2692-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180615_052956_298487_4A1701A7 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. 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: Nicholas Mc Guire , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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_find_compatible_node() returns a node pointer with refcount incremented thus it must be explicitly decremented here after the last usage. (see drivers/of/base.c:of_find_compatible_node()) Signed-off-by: Nicholas Mc Guire --- Problem located with an experimental coccinelle script Patch was compile tested with: axm55xx_defconfig (with some sparse warnings - not related to the proposed change though) Patch is against 4.17.0 (localversion-next is next-20180614) 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 @@ -40,10 +40,11 @@ static int axxia_boot_secondary(unsigned int cpu, struct task_struct *idle) syscon_np = of_find_compatible_node(NULL, NULL, "lsi,axxia-syscon"); if (!syscon_np) return -ENOENT; syscon = of_iomap(syscon_np, 0); + of_node_put(syscon_np); if (!syscon) return -ENOMEM; tmp = readl(syscon + SC_RST_CPU_HOLD); writel(0xab, syscon + SC_CRIT_WRITE_KEY);