diff options
author | Robert Hancock <hancock@sedsystems.ca> | 2019-06-07 01:28:10 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-07 02:24:29 +0300 |
commit | e7a3d116fa6fd1b898f6d7421a07f01fa38394b9 (patch) | |
tree | 25fbdcca741bccfd5279c50ae9df13f81da0981f /drivers/net/ethernet/xilinx | |
parent | 09a0354cadec267be7f5249c89eb998b3474263a (diff) | |
download | linux-e7a3d116fa6fd1b898f6d7421a07f01fa38394b9.tar.xz |
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>
Diffstat (limited to 'drivers/net/ethernet/xilinx')
-rw-r--r-- | drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 42b343cb3e2b..5cb39deca8d2 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -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); |