Re: Re: [PATCH net] net: phy: micrel: Fix potential shared PHC use-after-free
From: Andrew Lunn
Date: Mon Nov 09 2026 - 08:38:18 EST
> >.probe() and .remove() should be opposites of each other. What happens
> >if you do that?
> >
> > Andrew
> >
> >---
> >pw-bot: cr
> >
>
> On LAN8814, one PHY registers the shared PHC and owns its pin array.
> If that PHY unregisters the clock in .remove(), the clock goes away
> before the pins are freed. If another port is still bound, it loses
> access to the PHC. I added the handoff in v1 to keep the clock
> available in that case.
>
> I'll rework this around the PHY that registered the clock. I'll check
> how the remaining ports report the PHC after that PHY unbinds, and
> what happens if it binds again while another port is still up.
That is not what i asked for:
.probe() and .remove() should be opposites of each other.
Take the probe function and reverse the order of the lines.
Then reverse what each function does.
Andrew