提交 e7a3d116 编写于 作者: R Robert Hancock 提交者: 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: NRobert Hancock <hancock@sedsystems.ca>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 09a0354c
......@@ -1651,8 +1651,8 @@ static int axienet_remove(struct platform_device *pdev)
struct net_device *ndev = platform_get_drvdata(pdev);
struct axienet_local *lp = netdev_priv(ndev);
axienet_mdio_teardown(lp);
unregister_netdev(ndev);
axienet_mdio_teardown(lp);
if (lp->clk)
clk_disable_unprepare(lp->clk);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册