Skip to content

Commit 2933fb2

Browse files
ffainelligregkh
authored andcommitted
net: phy: Fix PHY unbind crash
commit 7b9a88a390dacb37b051a7b09b9a08f546edf5eb upstream. The PHY library does not deal very well with bind and unbind events. The first thing we would see is that we were not properly canceling the PHY state machine workqueue, so we would be crashing while dereferencing phydev->drv since there is no driver attached anymore. Suggested-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a8f1b40 commit 2933fb2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/net/phy/phy_device.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,6 +1368,8 @@ static int phy_remove(struct device *dev)
13681368
{
13691369
struct phy_device *phydev = to_phy_device(dev);
13701370

1371+
cancel_delayed_work_sync(&phydev->state_queue);
1372+
13711373
mutex_lock(&phydev->lock);
13721374
phydev->state = PHY_DOWN;
13731375
mutex_unlock(&phydev->lock);

0 commit comments

Comments
 (0)