[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201028091542.136120-1-miaoqinglang@huawei.com>
Date: Wed, 28 Oct 2020 17:15:42 +0800
From: Qinglang Miao <miaoqinglang@...wei.com>
To: Lubomir Rintel <lkundrak@...sk>,
Russell King <linux@...linux.org.uk>
CC: <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>,
Qinglang Miao <miaoqinglang@...wei.com>
Subject: [PATCH] ARM: mmp: fix missing clk_disable_unprepare() on error in mmp_dt_init_timer
Fix the missing clk_disable_unprepare() before return from
mmp_dt_init_timer() in the error handling case.
Signed-off-by: Qinglang Miao <miaoqinglang@...wei.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
Powered by blists - more mailing lists