]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
clk: imx: Free pll on error path
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Wed, 23 Jul 2025 16:32:45 +0000 (17:32 +0100)
committerFabio Estevam <festevam@gmail.com>
Thu, 7 Aug 2025 11:13:17 +0000 (08:13 -0300)
For an unknown pll type the error path neglects to free the memory just
allocated. Add the free.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/clk/imx/clk-pll14xx.c

index 7ec78dc3a80b79aa5c5f0fe5067dfa1d104e8c48..f9fcec18f9f8b599163a0db85d61b5255f526c29 100644 (file)
@@ -409,6 +409,7 @@ struct clk *imx_clk_pll14xx(const char *name, const char *parent_name,
        default:
                pr_err("%s: Unknown pll type for pll clk %s\n",
                       __func__, name);
+               kfree(pll);
                return ERR_PTR(-EINVAL);
        };