[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200823130640.11765-1-dinghao.liu@zju.edu.cn>
Date: Sun, 23 Aug 2020 21:06:40 +0800
From: Dinghao Liu <dinghao.liu@....edu.cn>
To: dinghao.liu@....edu.cn, kjlu@....edu
Cc: Michal Simek <michal.simek@...inx.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] clocksource/drivers/cadence-ttc: Fix memleak in ttc_setup_clockevent
When clk_notifier_register() fails, ttcce should be freed
just like when clk_prepare_enable() and request_irq() fail.
Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
---
drivers/clocksource/timer-cadence-ttc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c
index 38858e141731..4d8638b0936c 100644
--- a/drivers/clocksource/timer-cadence-ttc.c
+++ b/drivers/clocksource/timer-cadence-ttc.c
@@ -426,6 +426,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
&ttcce->ttc.clk_rate_change_nb);
if (err) {
pr_warn("Unable to register clock notifier.\n");
+ kfree(ttcce);
return err;
}
--
2.17.1
Powered by blists - more mailing lists