All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: imx27: Fix refcount leak in mx27_suspend_enter
@ 2022-05-16  3:52 ` Miaoqian Lin
  0 siblings, 0 replies; 2+ messages in thread
From: Miaoqian Lin @ 2022-05-16  3:52 UTC (permalink / raw)
  To: Russell King, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Miaoqian Lin, Arnd Bergmann,
	linux-arm-kernel, linux-kernel

of_find_compatible_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: d54debc72f5f ("ARM: imx27: Retrieve the CCM base address from devicetree")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 arch/arm/mach-imx/pm-imx27.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c
index 237e8aa9fe83..179506196f8e 100644
--- a/arch/arm/mach-imx/pm-imx27.c
+++ b/arch/arm/mach-imx/pm-imx27.c
@@ -24,6 +24,7 @@ static int mx27_suspend_enter(suspend_state_t state)
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
 	ccm_base = of_iomap(np, 0);
 	BUG_ON(!ccm_base);
+	of_node_put(np);
 
 	switch (state) {
 	case PM_SUSPEND_MEM:
-- 
2.25.1


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

* [PATCH] ARM: imx27: Fix refcount leak in mx27_suspend_enter
@ 2022-05-16  3:52 ` Miaoqian Lin
  0 siblings, 0 replies; 2+ messages in thread
From: Miaoqian Lin @ 2022-05-16  3:52 UTC (permalink / raw)
  To: Russell King, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, NXP Linux Team, Miaoqian Lin, Arnd Bergmann,
	linux-arm-kernel, linux-kernel

of_find_compatible_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: d54debc72f5f ("ARM: imx27: Retrieve the CCM base address from devicetree")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 arch/arm/mach-imx/pm-imx27.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c
index 237e8aa9fe83..179506196f8e 100644
--- a/arch/arm/mach-imx/pm-imx27.c
+++ b/arch/arm/mach-imx/pm-imx27.c
@@ -24,6 +24,7 @@ static int mx27_suspend_enter(suspend_state_t state)
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm");
 	ccm_base = of_iomap(np, 0);
 	BUG_ON(!ccm_base);
+	of_node_put(np);
 
 	switch (state) {
 	case PM_SUSPEND_MEM:
-- 
2.25.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] 2+ messages in thread

end of thread, other threads:[~2022-05-16  3:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16  3:52 [PATCH] ARM: imx27: Fix refcount leak in mx27_suspend_enter Miaoqian Lin
2022-05-16  3:52 ` Miaoqian Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.