Re: [PATCH 02/10] clk: tegra: bpmp: Drop manual clock unregister on provider failure

From: Thierry Reding

Date: Fri Dec 04 2026 - 07:41:53 EST


On Fri, Nov 27, 2026 at 07:25:26PM +0000, Lee Jones wrote:
> tegra_bpmp_clk_register() registers every clock with
> devm_clk_hw_register(), and tegra_bpmp_register_clocks_one() records
> ERR_PTR values in bpmp->clocks[i] whenever an individual clock fails to
> register. If of_clk_add_hw_provider() fails,
> tegra_bpmp_unregister_clocks() unconditionally dereferences
> bpmp->clocks[i] and calls clk_hw_unregister(), crashing on any error
> pointer and double-unregistering clocks when devres subsequently unwinds
> on probe failure.
>
> Remove tegra_bpmp_unregister_clocks() and rely on devres to unregister
> the clocks cleanly.
>
> Fixes: ca6f2796eef7 ("clk: tegra: Add BPMP clock driver")

Not sure it's really worth porting this back to 10 years worth of stable
trees since there's not been a single report of this ever happening. But
it's also not a very big patch, so might as well leave it here.

Brian, do you want me to take this via the Tegra tree? I already have
that "clk: tegra: bpmp: Do not cache the EMC clock rate" patch in that
tree, and while I don't think it's going to cause any conflicts, seems
reasonable to keep them all together.

Thierry

Attachment: signature.asc
Description: PGP signature