* [PATCH AUTOSEL 4.9 13/13] arm: mach-spear: Add missing of_node_put() in time.c
[not found] <20220628022657.597208-1-sashal@kernel.org>
@ 2022-06-28 2:26 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2022-06-28 2:26 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Liang He, Viresh Kumar, Arnd Bergmann, Sasha Levin, vireshk,
shiraz.linux.kernel, soc, linux, linux-arm-kernel
From: Liang He <windhl@126.com>
[ Upstream commit 2c629dd2d14fd7f64a553f809eda6d0b3a4f615a ]
In spear_setup_of_timer(), of_find_matching_node() will return a
node pointer with refcount incrementd. We should use of_node_put()
in each fail path or when it is not used anymore.
Signed-off-by: Liang He <windhl@126.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20220616093027.3984903-1-windhl@126.com'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/mach-spear/time.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c
index aaaa6781b9fe..57b77c7effa9 100644
--- a/arch/arm/mach-spear/time.c
+++ b/arch/arm/mach-spear/time.c
@@ -223,13 +223,13 @@ void __init spear_setup_of_timer(void)
irq = irq_of_parse_and_map(np, 0);
if (!irq) {
pr_err("%s: No irq passed for timer via DT\n", __func__);
- return;
+ goto err_put_np;
}
gpt_base = of_iomap(np, 0);
if (!gpt_base) {
pr_err("%s: of iomap failed\n", __func__);
- return;
+ goto err_put_np;
}
gpt_clk = clk_get_sys("gpt0", NULL);
@@ -244,6 +244,8 @@ void __init spear_setup_of_timer(void)
goto err_prepare_enable_clk;
}
+ of_node_put(np);
+
spear_clockevent_init(irq);
spear_clocksource_init();
@@ -253,4 +255,6 @@ void __init spear_setup_of_timer(void)
clk_put(gpt_clk);
err_iomap:
iounmap(gpt_base);
+err_put_np:
+ of_node_put(np);
}
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH AUTOSEL 4.9 13/13] arm: mach-spear: Add missing of_node_put() in time.c
[not found] <20220914090540.471725-1-sashal@kernel.org>
@ 2022-09-14 9:05 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2022-09-14 9:05 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Liang He, Viresh Kumar, Arnd Bergmann, Sasha Levin, vireshk,
shiraz.linux.kernel, soc, linux, linux-arm-kernel
From: Liang He <windhl@126.com>
[ Upstream commit 2c629dd2d14fd7f64a553f809eda6d0b3a4f615a ]
In spear_setup_of_timer(), of_find_matching_node() will return a
node pointer with refcount incrementd. We should use of_node_put()
in each fail path or when it is not used anymore.
Signed-off-by: Liang He <windhl@126.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20220616093027.3984903-1-windhl@126.com'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/mach-spear/time.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c
index aaaa6781b9fea..57b77c7effa9a 100644
--- a/arch/arm/mach-spear/time.c
+++ b/arch/arm/mach-spear/time.c
@@ -223,13 +223,13 @@ void __init spear_setup_of_timer(void)
irq = irq_of_parse_and_map(np, 0);
if (!irq) {
pr_err("%s: No irq passed for timer via DT\n", __func__);
- return;
+ goto err_put_np;
}
gpt_base = of_iomap(np, 0);
if (!gpt_base) {
pr_err("%s: of iomap failed\n", __func__);
- return;
+ goto err_put_np;
}
gpt_clk = clk_get_sys("gpt0", NULL);
@@ -244,6 +244,8 @@ void __init spear_setup_of_timer(void)
goto err_prepare_enable_clk;
}
+ of_node_put(np);
+
spear_clockevent_init(irq);
spear_clocksource_init();
@@ -253,4 +255,6 @@ void __init spear_setup_of_timer(void)
clk_put(gpt_clk);
err_iomap:
iounmap(gpt_base);
+err_put_np:
+ of_node_put(np);
}
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-14 9:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220628022657.597208-1-sashal@kernel.org>
2022-06-28 2:26 ` [PATCH AUTOSEL 4.9 13/13] arm: mach-spear: Add missing of_node_put() in time.c Sasha Levin
[not found] <20220914090540.471725-1-sashal@kernel.org>
2022-09-14 9:05 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox