summaryrefslogtreecommitdiff
path: root/arch/arm/mach-rockchip
diff options
context:
space:
mode:
authorLiang He <windhl@126.com>2022-06-16 05:17:13 +0300
committerHeiko Stuebner <heiko@sntech.de>2022-06-17 20:05:51 +0300
commitf4470dbfb5ff92804650bc71d115c3f150d430f6 (patch)
tree1a6ca93a6cd8c0d3cbec6ce11209f7dd4aff6801 /arch/arm/mach-rockchip
parentf2906aa863381afb0015a9eb7fefad885d4e5a56 (diff)
downloadlinux-f4470dbfb5ff92804650bc71d115c3f150d430f6.tar.xz
ARM: rockchip: Add missing of_node_put() in rockchip_suspend_init()
In rockchip_suspend_init(), of_find_matching_node_and_match() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore. Signed-off-by: Liang He <windhl@126.com> Link: https://lore.kernel.org/r/20220616021713.3973472-1-windhl@126.com Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Diffstat (limited to 'arch/arm/mach-rockchip')
-rw-r--r--arch/arm/mach-rockchip/pm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
index 87389d9456b9..30d781d80fe0 100644
--- a/arch/arm/mach-rockchip/pm.c
+++ b/arch/arm/mach-rockchip/pm.c
@@ -311,7 +311,7 @@ void __init rockchip_suspend_init(void)
&match);
if (!match) {
pr_err("Failed to find PMU node\n");
- return;
+ goto out_put;
}
pm_data = (struct rockchip_pm_data *) match->data;
@@ -320,9 +320,12 @@ void __init rockchip_suspend_init(void)
if (ret) {
pr_err("%s: matches init error %d\n", __func__, ret);
- return;
+ goto out_put;
}
}
suspend_set_ops(pm_data->ops);
+
+out_put:
+ of_node_put(np);
}