diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-01-04 21:34:15 +0800 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2022-01-05 09:53:45 +0100 |
commit | a029ccc810b65172e02336d9caa0fe2331dc58b7 (patch) | |
tree | 1a1b5e5e6e484a1f8d84bc93983f59c54e2d8aac /drivers/platform/mips | |
parent | 79876cc1d7b801b28511440e5aec1b31d8df7a73 (diff) | |
download | linux-a029ccc810b65172e02336d9caa0fe2331dc58b7.tar.bz2 |
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>
Diffstat (limited to 'drivers/platform/mips')
-rw-r--r-- | drivers/platform/mips/ls2k-reset.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/mips/ls2k-reset.c b/drivers/platform/mips/ls2k-reset.c index b70e7b8a092c..8f42d5d16480 100644 --- a/drivers/platform/mips/ls2k-reset.c +++ b/drivers/platform/mips/ls2k-reset.c @@ -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; } |