Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 7eb7819a2e12 ("MIPS: Loongson64: Add Loongson-2K1000 reset platform driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Yang Yingliang and committed by
Thomas Bogendoerfer
a029ccc8 79876cc1

+1 -1
+1 -1
drivers/platform/mips/ls2k-reset.c
··· 38 38 } 39 39 40 40 base = of_iomap(np, 0); 41 + of_node_put(np); 41 42 if (!base) { 42 43 pr_info("Failed to map PM register base address\n"); 43 44 return -ENOMEM; ··· 47 46 _machine_restart = ls2k_restart; 48 47 pm_power_off = ls2k_poweroff; 49 48 50 - of_node_put(np); 51 49 return 0; 52 50 } 53 51