Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3beae8b4 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

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: default avatarColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210406170115.430990-1-colin.king@canonical.com


Acked-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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 97656f5f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -157,6 +157,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;
		}
	}