[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1559118208-28049-1-git-send-email-wangxidong_97@163.com>
Date: Wed, 29 May 2019 16:23:28 +0800
From: Xidong Wang <wangxidong_97@....com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>
Cc: Xidong Wang <wangxidong_97@....com>, linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] clocksource/drivers/integrator: check return value
In integrator_ap_timer_init_of(), the return value of
clk_prepare_enable() should be checked before clk is used.
Signed-off-by: Xidong Wang <wangxidong_97@....com>
---
drivers/clocksource/timer-integrator-ap.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/clocksource/timer-integrator-ap.c b/drivers/clocksource/timer-integrator-ap.c
index 19fb7de..72d5bdc 100644
--- a/drivers/clocksource/timer-integrator-ap.c
+++ b/drivers/clocksource/timer-integrator-ap.c
@@ -177,6 +177,7 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)
{
const char *path;
void __iomem *base;
+ int ret;
int err;
int irq;
struct clk *clk;
@@ -192,7 +193,10 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)
pr_err("No clock for %pOFn\n", node);
return PTR_ERR(clk);
}
- clk_prepare_enable(clk);
+ ret = clk_prepare_enable(clk);
+ if (ret) {
+ return ret;
+ }
rate = clk_get_rate(clk);
writel(0, base + TIMER_CTRL);
--
2.7.4
Powered by blists - more mailing lists