clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return
[ Upstream commit 657d4d1934
]
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>
pull/331/head^2
parent
573bbb6f80
commit
932329941c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue