* [PATCH] ARM: mmp: fix missing clk_disable_unprepare() on error in mmp_dt_init_timer
@ 2020-10-28 9:15 ` Qinglang Miao
0 siblings, 0 replies; 2+ messages in thread
From: Qinglang Miao @ 2020-10-28 9:15 UTC (permalink / raw)
To: Lubomir Rintel, Russell King
Cc: linux-arm-kernel, linux-kernel, Qinglang Miao
Fix the missing clk_disable_unprepare() before return from
mmp_dt_init_timer() in the error handling case.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
arch/arm/mach-mmp/time.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 41b2e8abc..212823800 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -209,12 +209,15 @@ static int __init mmp_dt_init_timer(struct device_node *np)
}
irq = irq_of_parse_and_map(np, 0);
- if (!irq)
+ if (!irq) {
+ clk_disable_unprepare(clk);
return -EINVAL;
-
+ }
mmp_timer_base = of_iomap(np, 0);
- if (!mmp_timer_base)
+ if (!mmp_timer_base) {
+ clk_disable_unprepare(clk);
return -ENOMEM;
+ }
mmp_timer_init(irq, rate);
return 0;
--
2.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] ARM: mmp: fix missing clk_disable_unprepare() on error in mmp_dt_init_timer
@ 2020-10-28 9:15 ` Qinglang Miao
0 siblings, 0 replies; 2+ messages in thread
From: Qinglang Miao @ 2020-10-28 9:15 UTC (permalink / raw)
To: Lubomir Rintel, Russell King
Cc: Qinglang Miao, linux-kernel, linux-arm-kernel
Fix the missing clk_disable_unprepare() before return from
mmp_dt_init_timer() in the error handling case.
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
arch/arm/mach-mmp/time.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index 41b2e8abc..212823800 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -209,12 +209,15 @@ static int __init mmp_dt_init_timer(struct device_node *np)
}
irq = irq_of_parse_and_map(np, 0);
- if (!irq)
+ if (!irq) {
+ clk_disable_unprepare(clk);
return -EINVAL;
-
+ }
mmp_timer_base = of_iomap(np, 0);
- if (!mmp_timer_base)
+ if (!mmp_timer_base) {
+ clk_disable_unprepare(clk);
return -ENOMEM;
+ }
mmp_timer_init(irq, rate);
return 0;
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-28 22:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28 9:15 [PATCH] ARM: mmp: fix missing clk_disable_unprepare() on error in mmp_dt_init_timer Qinglang Miao
2020-10-28 9:15 ` Qinglang Miao
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.