mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 11:33:58 -04:00
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: Robert Hancock <hancock@sedsystems.ca> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
09a0354cad
commit
e7a3d116fa
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user