public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] arm/xen: Fix refcount leak in xen_dt_guest_init
@ 2022-03-09 10:24 Miaoqian Lin
  2022-03-12  2:01 ` Stefano Stabellini
  0 siblings, 1 reply; 5+ messages in thread
From: Miaoqian Lin @ 2022-03-09 10:24 UTC (permalink / raw)
  To: Stefano Stabellini, Russell King, Catalin Marinas, Shannon Zhao,
	Julien Grall, xen-devel, linux-arm-kernel, linux-kernel
  Cc: linmq006

The of_find_compatible_node() function returns a node pointer with
refcount incremented, We should use of_node_put() on it when done
Add the missing of_node_put() to release the refcount.

Fixes: 9b08aaa3199a ("ARM: XEN: Move xen_early_init() before efi_init()")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 arch/arm/xen/enlighten.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index ec5b082f3de6..262f45f686b6 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -424,6 +424,7 @@ static void __init xen_dt_guest_init(void)
 
 	if (of_address_to_resource(xen_node, GRANT_TABLE_INDEX, &res)) {
 		pr_err("Xen grant table region is not found\n");
+		of_node_put(xen_node);
 		return;
 	}
 	xen_grant_frames = res.start;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-22  0:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-09 10:24 [PATCH] arm/xen: Fix refcount leak in xen_dt_guest_init Miaoqian Lin
2022-03-12  2:01 ` Stefano Stabellini
2022-04-06  2:19   ` Miaoqian Lin
2022-04-20  1:49     ` [PATCH v2] arm/xen: Fix some refcount leaks Miaoqian Lin
2022-04-22  0:36       ` Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox