Skip to content

Commit

Permalink
net: mv643xx_eth: use phy_disconnect instead of phy_detach
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Hesselbarth authored and David S. Miller committed May 31, 2013
1 parent 9e7c414 commit cec753f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit cec753f

Please sign in to comment.