[PATCH] clk: imx: Free pll on error path

Andrew Goodbody andrew.goodbody at linaro.org
Wed Jul 23 18:32:45 CEST 2025


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 at linaro.org>
---
 drivers/clk/imx/clk-pll14xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c
index 7ec78dc3a80..f9fcec18f9f 100644
--- a/drivers/clk/imx/clk-pll14xx.c
+++ b/drivers/clk/imx/clk-pll14xx.c
@@ -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);
 	};
 

---
base-commit: bd0ade7d090a334b3986936d63a34001d99722ad
change-id: 20250723-clk-pll14xx-0dd5bd34a2b2

Best regards,
-- 
Andrew Goodbody <andrew.goodbody at linaro.org>



More information about the U-Boot mailing list