[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190309131958.17996-1-yuehaibing@huawei.com>
Date: Sat, 9 Mar 2019 21:19:58 +0800
From: Yue Haibing <yuehaibing@...wei.com>
To: <michal.simek@...inx.com>, <daniel.lezcano@...aro.org>,
<tglx@...utronix.de>
CC: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
YueHaibing <yuehaibing@...wei.com>
Subject: [PATCH] clocksource: cadence_ttc: fix memory leak in ttc_setup_clockevent
From: YueHaibing <yuehaibing@...wei.com>
Add the missing kfree() in ttc_setup_clockevent() to free the
mem before error return.
Fixes: 70504f311d4b ("clocksource/drivers/cadence_ttc: Convert init function to return error")
Signed-off-by: YueHaibing <yuehaibing@...wei.com>
---
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 b334029..b664af8 100644
--- a/drivers/clocksource/timer-cadence-ttc.c
+++ b/drivers/clocksource/timer-cadence-ttc.c
@@ -432,6 +432,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.7.0
Powered by blists - more mailing lists