From: Sebastian Hesselbarth Date: Wed, 29 May 2013 09:32:43 +0000 (+0000) Subject: net: mv643xx_eth: use phy_disconnect instead of phy_detach X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cec753f5dd103fcfef28c1d1c942395000abe15e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net: mv643xx_eth: use phy_disconnect instead of phy_detach 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index afb8bcbe29f8..8124464af83c 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -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))