clk: socfpga: Fix memory leak in socfpga_gate_init()
authorXiu Jianfeng <xiujianfeng@huawei.com>
Wed, 23 Nov 2022 03:16:22 +0000 (11:16 +0800)
committerStephen Boyd <sboyd@kernel.org>
Fri, 9 Dec 2022 01:16:14 +0000 (17:16 -0800)
commit0b8ba891ad4d1ef6bfa4c72efc83f9f9f855f68b
tree3dca1d16dfdf0b9579acf0d3f7271895d8695aa4
parentcfd3ffb36f0d566846163118651d868e607300ba
clk: socfpga: Fix memory leak in socfpga_gate_init()

Free @socfpga_clk and @ops on the error path to avoid memory leak issue.

Fixes: a30a67be7b6e ("clk: socfpga: Don't have get_parent for single parent ops")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Link: https://lore.kernel.org/r/20221123031622.63171-1-xiujianfeng@huawei.com
Acked-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/socfpga/clk-gate.c