Skip to contentSkip to conversation

soc: tegra: fuse: Add missing of_node_put in tegra_init_fuse

PATCH New Liang He 1 participant 1 message Jun 16, 2022 Tegra architecture support

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH v2 1/1 soc: tegra: fuse: Add missing of_node_put in tegra_init_fuse

In this function, of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put when the pointer *np* is not used anymore.

---
changelog:

v2: use real name for Sob
v1: fix the bug

 drivers/soc/tegra/fuse/fuse-tegra.c | 1 +
 1 file changed, 1 insertion(+)
drivers/soc/tegra/fuse/fuse-tegra.c +1 -0
index b0a8405dbdb1..6542267a224d 100644
@@ -568,6 +568,7 @@ static int __init tegra_init_fuse(void)
 	np = of_find_matching_node(NULL, car_match);
 	if (np) {
 		void __iomem *base = of_iomap(np, 0);
+		of_node_put(np);
 		if (base) {
 			tegra_enable_fuse_clk(base);
 			iounmap(base);
Signature · 1 line
2.25.1