Skip to content

Commit a029ccc

Browse files
Yang Yingliangtsbogend
authored andcommitted
MIPS: Loongson64: Add missing of_node_put() in ls2k_reset_init()
This node pointer is returned by of_find_compatible_node() with refcount incremented in ls2k_reset_init(). Calling of_node_put() to aovid the refcount leak. Fixes: 7eb7819 ("MIPS: Loongson64: Add Loongson-2K1000 reset platform driver") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 79876cc commit a029ccc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/mips/ls2k-reset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static int ls2k_reset_init(void)
3838
}
3939

4040
base = of_iomap(np, 0);
41+
of_node_put(np);
4142
if (!base) {
4243
pr_info("Failed to map PM register base address\n");
4344
return -ENOMEM;
@@ -46,7 +47,6 @@ static int ls2k_reset_init(void)
4647
_machine_restart = ls2k_restart;
4748
pm_power_off = ls2k_poweroff;
4849

49-
of_node_put(np);
5050
return 0;
5151
}
5252

0 commit comments

Comments
 (0)