[PATCH] soc: fsl: Add missing of_node_put() after using device_node

Zhang Zekun zhangzekun11 at huawei.com
Wed Nov 6 18:11:23 AEDT 2024


of_find_compatible_node() will increase the refcount of the device_node.
Decrease the refcount once finish using it.

Fixes: e95f287deed2 ("soc: fsl: handle RCPM errata A-008646 on SoC LS1021A")
Signed-off-by: Zhang Zekun <zhangzekun11 at huawei.com>
---
 drivers/soc/fsl/rcpm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
index 3d0cae30c769..06bd94b29fb3 100644
--- a/drivers/soc/fsl/rcpm.c
+++ b/drivers/soc/fsl/rcpm.c
@@ -36,6 +36,7 @@ static void copy_ippdexpcr1_setting(u32 val)
 		return;
 
 	regs = of_iomap(np, 0);
+	of_node_put(np);
 	if (!regs)
 		return;
 
-- 
2.17.1



More information about the Linuxppc-dev mailing list