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]
Date:   Wed, 22 Jun 2022 14:21:38 +0800
From:   Liang He <windhl@....com>
To:     tglx@...utronix.de, maz@...nel.org, linux-kernel@...r.kernel.org,
        windhl@....com
Subject: [PATCH] irqchip: Add missing of_ndoe_get() in its_of_probe()

We need to add missing of_node_get() for of_find_matching_node() to
keep refcount balance.

Note: of_find_matching_node() will decrease the refcount of its first
arg.

Signed-off-by: Liang He <windhl@....com>
---
 drivers/irqchip/irq-gic-v3-its.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 5ff09de6c48f..829893cc5e10 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -5309,6 +5309,7 @@ static int __init its_of_probe(struct device_node *node)
 	 * reset, don't even try to go any further, as this could
 	 * result in something even worse.
 	 */
+	of_node_get(node);
 	for (np = of_find_matching_node(node, its_device_id); np;
 	     np = of_find_matching_node(np, its_device_id)) {
 		int err;
@@ -5323,6 +5324,7 @@ static int __init its_of_probe(struct device_node *node)
 			return err;
 	}
 
+	of_node_get(node);
 	for (np = of_find_matching_node(node, its_device_id); np;
 	     np = of_find_matching_node(np, its_device_id)) {
 		if (!of_device_is_available(np))
-- 
2.25.1

Powered by blists - more mailing lists