提交 a029ccc8 编写于 作者: Y Yang Yingliang 提交者: 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: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
上级 79876cc1
...@@ -38,6 +38,7 @@ static int ls2k_reset_init(void) ...@@ -38,6 +38,7 @@ static int ls2k_reset_init(void)
} }
base = of_iomap(np, 0); base = of_iomap(np, 0);
of_node_put(np);
if (!base) { if (!base) {
pr_info("Failed to map PM register base address\n"); pr_info("Failed to map PM register base address\n");
return -ENOMEM; return -ENOMEM;
...@@ -46,7 +47,6 @@ static int ls2k_reset_init(void) ...@@ -46,7 +47,6 @@ static int ls2k_reset_init(void)
_machine_restart = ls2k_restart; _machine_restart = ls2k_restart;
pm_power_off = ls2k_poweroff; pm_power_off = ls2k_poweroff;
of_node_put(np);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册