linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/devicetree: Fix refcount leak in dtb_lapic_setup
@ 2022-04-02  8:46 cgel.zte
  0 siblings, 0 replies; only message in thread
From: cgel.zte @ 2022-04-02  8:46 UTC (permalink / raw)
  To: tglx
  Cc: mingo, bp, dave.hansen, x86, hpa, robh, lv.ruyi, frank.rowand,
	linux-kernel, Zeal Robot

From: Lv Ruyi <lv.ruyi@zte.com.cn>

If dn is true that meas the of_find_compatible_node function 
successfully returns a node pointer with refcount incremented, 
use of_node_put() on it when done.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 arch/x86/kernel/devicetree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 5cd51f25f446..6498825cf48d 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -156,6 +156,7 @@ static void __init dtb_lapic_setup(void)
 	dn = of_find_compatible_node(NULL, NULL, "intel,ce4100-lapic");
 	if (dn) {
 		ret = of_address_to_resource(dn, 0, &r);
+		of_node_put(dn);
 		if (WARN_ON(ret))
 			return;
 		lapic_addr = r.start;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-02  8:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-02  8:46 [PATCH] x86/devicetree: Fix refcount leak in dtb_lapic_setup cgel.zte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).