summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-04-06 18:01:15 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-11 14:04:10 +0200
commite0be54070ba12332176695bb2e8680b2eaec16a6 (patch)
tree18072cd0396d61cf2665321fa8abe4248ad4683a /drivers/clk
parent330753d38f26722612f60e2d9fd4d33159fa14a9 (diff)
downloadlinux-e0be54070ba12332176695bb2e8680b2eaec16a6.tar.gz
linux-e0be54070ba12332176695bb2e8680b2eaec16a6.tar.bz2
linux-e0be54070ba12332176695bb2e8680b2eaec16a6.zip
clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return
[ Upstream commit 657d4d1934f75a2d978c3cf2086495eaa542e7a9 ] 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: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210406170115.430990-1-colin.king@canonical.com Acked-by: Dinh Nguyen <dinguyen@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/socfpga/clk-gate-a10.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clk/socfpga/clk-gate-a10.c b/drivers/clk/socfpga/clk-gate-a10.c
index cd5df9103614..d62778884208 100644
--- a/drivers/clk/socfpga/clk-gate-a10.c
+++ b/drivers/clk/socfpga/clk-gate-a10.c
@@ -146,6 +146,7 @@ static void __init __socfpga_gate_init(struct device_node *node,
if (IS_ERR(socfpga_clk->sys_mgr_base_addr)) {
pr_err("%s: failed to find altr,sys-mgr regmap!\n",
__func__);
+ kfree(socfpga_clk);
return;
}
}