lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220615091240.3961831-1-windhl@126.com>
Date:   Wed, 15 Jun 2022 17:12:40 +0800
From:   heliang <windhl@....com>
To:     daniel@...que.org, haojian.zhuang@...il.com,
        robert.jarzmik@...e.fr, linux@...linux.org.uk
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        windhl@....com
Subject: [PATCH] arch: arm: mach-pxa: Add missing of_node_put in irq.c

In pxa_dt_irq_init(), of_find_matching_node() will return a node
pointer with refcount incremented. We should use of_node_put in
fail path or when it is not used anymore.

Signed-off-by: heliang <windhl@....com>
---
 arch/arm/mach-pxa/irq.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 96f33ef1d9ea..a81e9ffb77af 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -246,12 +246,14 @@ void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int))
 	ret = of_property_read_u32(node, "marvell,intc-nr-irqs",
 				   &pxa_internal_irq_nr);
 	if (ret) {
+		of_node_put(node);
 		pr_err("Not found marvell,intc-nr-irqs property\n");
 		return;
 	}
 
 	ret = of_address_to_resource(node, 0, &res);
 	if (ret < 0) {
+		of_node_put(node);
 		pr_err("No registers defined for node\n");
 		return;
 	}
@@ -262,10 +264,12 @@ void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int))
 
 	ret = irq_alloc_descs(-1, 0, pxa_internal_irq_nr, 0);
 	if (ret < 0) {
+		of_node_put(node);
 		pr_err("Failed to allocate IRQ numbers\n");
 		return;
 	}
 
 	pxa_init_irq_common(node, pxa_internal_irq_nr, fn);
+	of_node_put(node);
 }
 #endif /* CONFIG_OF */
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ