diff options
author | Peng Fan <peng.fan@nxp.com> | 2023-01-04 14:00:29 +0300 |
---|---|---|
committer | Abel Vesa <abel.vesa@linaro.org> | 2023-01-29 21:29:17 +0300 |
commit | f4419db4086e8c31821da14140e81498516a3c75 (patch) | |
tree | ee671b99ccdca314ca94768e6221198e8cea6f08 /drivers/clk/imx | |
parent | 1b929c02afd37871d5afb9d498426f83432e71c2 (diff) | |
download | linux-f4419db4086e8c31821da14140e81498516a3c75.tar.xz |
clk: imx: avoid memory leak
In case imx_register_uart_clocks return early, the imx_uart_clocks
memory will be no freed. So execute kfree always to avoid memory leak.
Fixes: 379c9a24cc23 ("clk: imx: Fix reparenting of UARTs not associated with stdout")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230104110032.1220721-2-peng.fan@oss.nxp.com
Diffstat (limited to 'drivers/clk/imx')
-rw-r--r-- | drivers/clk/imx/clk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index b636cc099d96..5b73a477f11f 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -205,9 +205,10 @@ static int __init imx_clk_disable_uart(void) clk_disable_unprepare(imx_uart_clocks[i]); clk_put(imx_uart_clocks[i]); } - kfree(imx_uart_clocks); } + kfree(imx_uart_clocks); + return 0; } late_initcall_sync(imx_clk_disable_uart); |