Commit a029ccc8 authored by Yang Yingliang's avatar Yang Yingliang Committed by Thomas Bogendoerfer

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: 7eb7819a ("MIPS: Loongson64: Add Loongson-2K1000 reset platform driver")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 79876cc1
......@@ -38,6 +38,7 @@ static int ls2k_reset_init(void)
}
base = of_iomap(np, 0);
of_node_put(np);
if (!base) {
pr_info("Failed to map PM register base address\n");
return -ENOMEM;
......@@ -46,7 +47,6 @@ static int ls2k_reset_init(void)
_machine_restart = ls2k_restart;
pm_power_off = ls2k_poweroff;
of_node_put(np);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment