net: hns3: add a missing uninit debugfs when unload driver
authorHuazhong Tan <tanhuazhong@huawei.com>
Mon, 6 Jul 2020 11:26:01 +0000 (19:26 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jul 2020 19:33:28 +0000 (12:33 -0700)
When unloading driver, if flag HNS3_NIC_STATE_INITED has been
already cleared, the debugfs will not be uninitialized, so fix it.

Fixes: b2292360bb2a ("net: hns3: Add debugfs framework registration")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index b14f2ab..c38f3bb 100644 (file)
@@ -4127,9 +4127,8 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)
 
        hns3_put_ring_config(priv);
 
-       hns3_dbg_uninit(handle);
-
 out_netdev_free:
+       hns3_dbg_uninit(handle);
        free_netdev(netdev);
 }