From nobody Sun Apr 12 21:51:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8099FC4332F for ; Sun, 18 Dec 2022 14:27:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230442AbiLRO1Y (ORCPT ); Sun, 18 Dec 2022 09:27:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbiLRO1R (ORCPT ); Sun, 18 Dec 2022 09:27:17 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACDEA63CC for ; Sun, 18 Dec 2022 06:27:16 -0800 (PST) Received: from dslb-178-004-201-210.178.004.pools.vodafone-ip.de ([178.4.201.210] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1p6udF-0007F2-R8; Sun, 18 Dec 2022 15:27:13 +0100 From: Martin Kaiser To: Andre Przywara , Russell King Cc: Martin Kaiser , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ARM: highbank: add missing of_node_put call Date: Sun, 18 Dec 2022 15:26:46 +0100 Message-Id: <20221218142647.394881-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221218142647.394881-1-martin@kaiser.cx> References: <20221218142647.394881-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" A node that is returned by of_find_compatible_node has its refcount incremented. We have to call of_node_put when the node is no longer needed. Add a missing of_node_put call in function highbank_init. Signed-off-by: Martin Kaiser --- arch/arm/mach-highbank/highbank.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/hig= hbank.c index 5d4f977ac7d2..97ccb8c1b3cd 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -141,6 +141,7 @@ static void __init highbank_init(void) /* Map system registers */ np =3D of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs"); sregs_base =3D of_iomap(np, 0); + of_node_put(np); WARN_ON(!sregs_base); =20 pm_power_off =3D highbank_power_off; --=20 2.30.2 From nobody Sun Apr 12 21:51:55 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FDBFC4332F for ; Sun, 18 Dec 2022 14:27:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230443AbiLRO12 (ORCPT ); Sun, 18 Dec 2022 09:27:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230416AbiLRO1T (ORCPT ); Sun, 18 Dec 2022 09:27:19 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B9B07642 for ; Sun, 18 Dec 2022 06:27:18 -0800 (PST) Received: from dslb-178-004-201-210.178.004.pools.vodafone-ip.de ([178.4.201.210] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1p6udH-0007F2-Vr; Sun, 18 Dec 2022 15:27:16 +0100 From: Martin Kaiser To: Andre Przywara , Russell King Cc: Martin Kaiser , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ARM: highbank: fix of node handling in highbank_init_irq Date: Sun, 18 Dec 2022 15:26:47 +0100 Message-Id: <20221218142647.394881-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221218142647.394881-1-martin@kaiser.cx> References: <20221218142647.394881-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" highbank_init calls of_find_compatible_node and discards the returned node. We should save the node and call of_node_put on it when finished. Signed-off-by: Martin Kaiser Reviewed-by: Andre Przywara --- arch/arm/mach-highbank/highbank.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/hig= hbank.c index 97ccb8c1b3cd..54eb1422ef8f 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -50,10 +50,16 @@ static void highbank_l2c310_write_sec(unsigned long val= , unsigned reg) =20 static void __init highbank_init_irq(void) { + struct device_node *np; + irqchip_init(); =20 - if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) - highbank_scu_map_io(); + np =3D of_find_compatible_node(NULL, NULL, "arm,cortex-a9"); + if (!np) + return; + + highbank_scu_map_io(); + of_node_put(np); } =20 static void highbank_power_off(void) --=20 2.30.2