> > +void fixed_phy_unregister(struct phy_device *phy)
> > +{
> > +   phy_device_remove(phy);
> > +
> > +   fixed_phy_del(phy->mdio.addr);
> 
> fixed_phy_del() should also make sure that there is no dangling
> link_update callback registered, even though this is not fatal, as it
> checks whether the phydev is NULL, we should automatically unregister
> one by doing something like: fixed_phy_set_link_update(phydev, NULL) for
> robustness.

Hi Florian

I don't see how it could happen. The link_update callback is only
called from fixed_mdio_read(). But we have just called
phy_device_remove(). There should not be anything using
fixed_mdio_read() after that. Also, fixed_phy_del() first removes fp
from the list of fmb->phys, meaning it is no longer possible to find
it, and then kfree(fp). So if there is some way we have a dangling
link_update, we are in big trouble, and the locking is badly broken...

    Andrew

Reply via email to