clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return
authorColin Ian King <colin.king@canonical.com>
Tue, 6 Apr 2021 17:01:15 +0000 (18:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:28 +0000 (14:47 +0200)
commit932329941ca88214a0df51a88bfcd73120d3ccb1
tree094bac258ab784940e6465efb768896440f65490
parent573bbb6f80f1ac974a484f9e3db61cd2b399198c
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>
drivers/clk/socfpga/clk-gate-a10.c