hix5hd2_dev_remove() deletes the NAPI instance before unregistering the
netdev.
The netdev should be unregistered first so the networking core can stop the
device while its NAPI instance is still present. Delete the NAPI instance
after unregister_netdev() has completed, matching the usual teardown order
for drivers that call netif_napi_add() during probe.
Signed-off-by: Jiawen Liu <redacted>
---
drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
index e3e7f2270560..81d398918b1d 100644
--- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
@@ -1282,8 +1282,8 @@ static void hix5hd2_dev_remove(struct platform_device *pdev)
struct net_device *ndev = platform_get_drvdata(pdev);
struct hix5hd2_priv *priv = netdev_priv(ndev);
- netif_napi_del(&priv->napi);
unregister_netdev(ndev);
+ netif_napi_del(&priv->napi);
mdiobus_unregister(priv->bus);
mdiobus_free(priv->bus);
--
2.34.1