[PATCH] powerpc/embedded6xx/ls_uart: Add missing of_node_put()

Liang He windhl at 126.com
Mon Jun 20 16:59:04 AEST 2022


In ls_uarts_init(), we need to add a of_node_put() to keep refcount
balance.

Signed-off-by: Liang He <windhl at 126.com>
---
 arch/powerpc/platforms/embedded6xx/ls_uart.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c
index 0133e175a0fc..4ecbc55b37c0 100644
--- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
+++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
@@ -124,6 +124,8 @@ static int __init ls_uarts_init(void)
 	avr_clock = *(u32*)of_get_property(avr, "clock-frequency", &len);
 	phys_addr = ((u32*)of_get_property(avr, "reg", &len))[0];
 
+	of_node_put(avr);
+
 	if (!avr_clock || !phys_addr)
 		return -EINVAL;
 
-- 
2.25.1



More information about the Linuxppc-dev mailing list