Skip to contentSkip to conversation

soc: fsl: rcpm: Fix refcount leak in copy_ippdexpcr1_setting

PATCH New Miaoqian Lin 1 participant 1 message Mar 9, 2022 Freescale SoC drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: fsl: rcpm: Fix refcount leak in copy_ippdexpcr1_setting

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 e95f287deed2 ("soc: fsl: handle RCPM errata A-008646 on SoC LS1021A")
---
 drivers/soc/fsl/rcpm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/fsl/rcpm.c +1 -0
index 3d0cae30c769..06bd94b29fb3 100644
@@ -36,6 +36,7 @@ static void copy_ippdexpcr1_setting(u32 val)
 		return;
 
 	regs = of_iomap(np, 0);
+	of_node_put(np);
 	if (!regs)
 		return;
 
Signature · 1 line
2.17.1