net: mv643xx_eth: use phy_disconnect instead of phy_detach
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Wed, 29 May 2013 09:32:43 +0000 (09:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 May 2013 00:54:03 +0000 (17:54 -0700)
Using a separated mdio bus driver with mvmdio, phy_detach on network device
removal will not stop the phy and finally lead to NULL pointer dereference
in mvmdio due to non-existent network device. Use phy_disconnect instead
to properly stop phy device from accessing network device prior removal of
the network device.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mv643xx_eth.c

index afb8bcbe29f89d832608a77f176b9a03a627ad50..8124464af83cd9c027df38e559988f04f5b0c64a 100644 (file)
@@ -2805,7 +2805,7 @@ static int mv643xx_eth_remove(struct platform_device *pdev)
 
        unregister_netdev(mp->dev);
        if (mp->phy != NULL)
-               phy_detach(mp->phy);
+               phy_disconnect(mp->phy);
        cancel_work_sync(&mp->tx_timeout_task);
 
        if (!IS_ERR(mp->clk))