clk: zynqmp: Fix a memory leak
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Wed, 18 Aug 2021 06:59:28 +0000 (12:29 +0530)
committerStephen Boyd <sboyd@kernel.org>
Sun, 29 Aug 2021 04:26:12 +0000 (21:26 -0700)
Fix a memory leak of mux.

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/20210818065929.12835-3-shubhrajyoti.datta@xilinx.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/zynqmp/clk-mux-zynqmp.c

index 157d4a960bf4216ac8b7a91e33e065a0596649d0..17afce594f28876a99305d4b2f7b78c2313f4da3 100644 (file)
@@ -159,7 +159,7 @@ struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id,
        hw = &mux->hw;
        ret = clk_hw_register(NULL, hw);
        if (ret) {
-               kfree(hw);
+               kfree(mux);
                hw = ERR_PTR(ret);
        }