[PATCH v3] clk: mvebu: ap-cpu: fix missing clk_put() in ap_cpu_clock_probe()
Brian Masney
bmasney at redhat.com
Wed Jun 17 04:00:55 PDT 2026
On Wed, Jun 17, 2026 at 01:41:26AM +0000, Wentao Liang wrote:
> The function ap_cpu_clock_probe() calls of_clk_get() to obtain a
> reference to the parent clock for each CPU cluster, but it never
> releases it with clk_put(). The returned clk is used only to read
> the parent's name via __clk_get_name(), and the reference is leaked
> on every successful cluster initialization as well as on the error
> path when devm_clk_hw_register() fails.
>
> Rather than adding clk_put() calls, replace the of_clk_get() +
> __clk_get_name() pattern with of_clk_get_parent_name(), which is
> the intended API for this use case and handles the reference
> counting internally. This matches the pattern already used by the
> sibling drivers clk-cpu.c and clk-corediv.c.
>
> Fixes: f756e362d9384 ("clk: mvebu: add CPU clock driver for Armada 7K/8K")
> Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>
Reviewed-by: Brian Masney <bmasney at redhat.com>
For the future, if someone leaves a tag like Reviewed-by, or Tested-by,
then include it with your next version, unless something major changes
with the code. Don't post another version since Stephen's automation
will pick up my tag when he merges this.
Brian
More information about the linux-arm-kernel
mailing list