mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Andre Przywara <andre.przywara@arm.com>,
	Russell King <linux@armlinux.org.uk>
Cc: Martin Kaiser <martin@kaiser.cx>,
	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	[thread overview]
Message-ID: <20221218142647.394881-3-martin@kaiser.cx> (raw)
In-Reply-To: <20221218142647.394881-1-martin@kaiser.cx>

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 <martin@kaiser.cx>
---
 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/highbank.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)
 
 static void __init highbank_init_irq(void)
 {
+	struct device_node *np;
+
 	irqchip_init();
 
-	if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9"))
-		highbank_scu_map_io();
+	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9");
+	if (!np)
+		return;
+
+	highbank_scu_map_io();
+	of_node_put(np);
 }
 
 static void highbank_power_off(void)
-- 
2.30.2


  parent reply	other threads:[~2022-12-18 14:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-18 14:26 [PATCH 0/2] ARM: highbank: add missing of_node_put calls Martin Kaiser
2022-12-18 14:26 ` [PATCH 1/2] ARM: highbank: add missing of_node_put call Martin Kaiser
2022-12-20 13:32   ` Andre Przywara
2022-12-18 14:26 ` Martin Kaiser [this message]
2022-12-20 13:25   ` [PATCH 2/2] ARM: highbank: fix of node handling in highbank_init_irq Andre Przywara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221218142647.394881-3-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=andre.przywara@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®