Commit 657d4d19 authored by Colin Ian King's avatar Colin Ian King Committed by Stephen Boyd

clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return

There is an error return path that is not kfree'ing socfpga_clk leading
to a memory leak. Fix this by adding in the missing kfree call.

Addresses-Coverity: ("Resource leak")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210406170115.430990-1-colin.king@canonical.comAcked-by: default avatarDinh Nguyen <dinguyen@kernel.org>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent abbe1eff
...@@ -146,6 +146,7 @@ static void __init __socfpga_gate_init(struct device_node *node, ...@@ -146,6 +146,7 @@ static void __init __socfpga_gate_init(struct device_node *node,
if (IS_ERR(socfpga_clk->sys_mgr_base_addr)) { if (IS_ERR(socfpga_clk->sys_mgr_base_addr)) {
pr_err("%s: failed to find altr,sys-mgr regmap!\n", pr_err("%s: failed to find altr,sys-mgr regmap!\n",
__func__); __func__);
kfree(socfpga_clk);
return; return;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment