Skip to content

Commit 657d4d1

Browse files
Colin Ian Kingbebarino
authored andcommitted
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: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Dinh Nguyen <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent abbe1ef commit 657d4d1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/clk/socfpga/clk-gate-a10.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ static void __init __socfpga_gate_init(struct device_node *node,
146146
if (IS_ERR(socfpga_clk->sys_mgr_base_addr)) {
147147
pr_err("%s: failed to find altr,sys-mgr regmap!\n",
148148
__func__);
149+
kfree(socfpga_clk);
149150
return;
150151
}
151152
}

0 commit comments

Comments
 (0)