Re: [PATCH 02/10] clk: tegra: bpmp: Drop manual clock unregister on provider failure
From: Thierry Reding
Date: Fri Dec 04 2026 - 16:35:18 EST
On Fri, Dec 04, 2026 at 03:30:34PM +0100, Jerome Brunet wrote:
> On 2026-12-04 13:41 +0100, Thierry Reding wrote:
> > 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.
>
> Hi Thierry,
>
> I already applied it. Send what you have. I'd deal with the conflict if
> there is one.
No problem, thanks.
Thierry
Attachment:
signature.asc
Description: PGP signature