[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220722041343.39492-1-ruc_gongyuanjun@163.com>
Date: Fri, 22 Jul 2022 12:13:43 +0800
From: Yuanjun Gong <ruc_gongyuanjun@....com>
To: Yuanjun Gong <ruc_gongyuanjun@....com>,
Santosh Shilimkar <ssantosh@...nel.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] drivers/clk/keystone: avoid a memory leak
In ti_syscon_gate_clk_register, priv is allocated by devm_kzalloc.
On the error path, it should be freed before return.
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@....com>
---
drivers/clk/keystone/syscon-clk.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/keystone/syscon-clk.c b/drivers/clk/keystone/syscon-clk.c
index 19198325b909..d8919bdafe34 100644
--- a/drivers/clk/keystone/syscon-clk.c
+++ b/drivers/clk/keystone/syscon-clk.c
@@ -84,6 +84,7 @@ static struct clk_hw
ret = devm_clk_hw_register(dev, &priv->hw);
if (ret)
+ devm_kfree(dev, priv);
return ERR_PTR(ret);
return &priv->hw;
--
2.17.1
Powered by blists - more mailing lists