Re: [PATCH v2 4/7] clk: st: clkgen-pll: Add iounmap() in clkgen_c32_pll_setup()
From: Markus Elfring
Date: Wed Jan 21 2026 - 05:30:49 EST
> Add a iounmap() to release the memory allocated by
an call?
> clkgen_get_register_base() in error path.
Was such an improvable implementation detail detected by any known source code
analysis approaches?
…
> +++ b/drivers/clk/st/clkgen-pll.c
…
> @@ -829,6 +829,9 @@ static void __init clkgen_c32_pll_setup(struct device_node *np,
> kfree(pll_name);
> kfree(clk_data->clks);
> kfree(clk_data);
> +err_unmap:
> + if (pll_base)
> + iounmap(pll_base);
* I find this pointer check redundant because of a previous variable check.
https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/clk/st/clkgen-pll.c#L771-L773
* I suggest to refine the goto chain a bit more.
> }
>
> static void __init clkgen_c32_pll0_setup(struct device_node *np)
Regards,
Markus