Subject: Re: [PATCH net] net: bcmasp: fix double frees during remove

From: Jakub Kicinski <[email-masked]>
Date: Sat, 14 Mar 2026 08:45:10 -0700

On Fri, 13 Mar 2026 13:21:13 -0700 Justin Chen wrote:
> >> - Switch to devm_clk_get_optional() instead of
> >>    devm_clk_get_optional_enabled() so we can manage the clock ourselves.  
> > 
> > But it is unclear to me what problem this is solving.
> > Or how it relates to the first point - usually the aim
> > is to have one fix per patch.
> > 
> > Could you elaborate?
> >   
> The double free happens because we double disable the clock. Guess it is 
> not exactly a double free. We manage the clock at the driver level so we 
> disable it when it is unneeded. The default state is clock disabled when
> no interfaces are up. After we bring down the interfaces, the clock is 
> disabled, then when we unbind the driver, it hits a double disable.

AI points out we're not missing a bunch of disable calls if we fail
further down in .probe

> Sure I can turn this into two fixes.

Yes, please
-- 
pw-bot: cr