OSDN Git Service

net: phy: Fix PHY unbind crash
authorFlorian Fainelli <f.fainelli@gmail.com>
Sat, 18 Feb 2017 00:07:33 +0000 (16:07 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2017 16:08:55 +0000 (09:08 -0700)
commit2933fb22de6dc58ec1b8f0b1c8569d3699e5d7ea
treece7d016081e43e3e80b5116ab5bd3933eac98a2e
parenta8f1b40bb2da3819cda93a037124b34f56f5d5fa
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>
drivers/net/phy/phy_device.c