Commit e7a3d116 authored by Robert Hancock's avatar Robert Hancock Committed by David S. Miller

net: axienet: fix teardown order of MDIO bus

Since the MDIO is is brought up before the netdev is registered, it
should be torn down after the netdev is removed. Otherwise, PHY accesses
can potentially access freed MDIO bus references and cause a crash.
Signed-off-by: default avatarRobert Hancock <hancock@sedsystems.ca>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 09a0354c
...@@ -1651,8 +1651,8 @@ static int axienet_remove(struct platform_device *pdev) ...@@ -1651,8 +1651,8 @@ static int axienet_remove(struct platform_device *pdev)
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct axienet_local *lp = netdev_priv(ndev); struct axienet_local *lp = netdev_priv(ndev);
axienet_mdio_teardown(lp);
unregister_netdev(ndev); unregister_netdev(ndev);
axienet_mdio_teardown(lp);
if (lp->clk) if (lp->clk)
clk_disable_unprepare(lp->clk); clk_disable_unprepare(lp->clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment