[PATCH 4.19 117/140] net: hns3: clear pci private data when unload hns3 driver

From: Greg Kroah-Hartman
Date: Mon Dec 16 2019 - 13:06:10 EST


From: Jian Shen <shenjian15@xxxxxxxxxx>

[ Upstream commit ac864c2346d087dd3739435af1b8d36be5f60c75 ]

When unload hns3 driver, we should clear the pci private data.

Signed-off-by: Jian Shen <shenjian15@xxxxxxxxxx>
Signed-off-by: Peng Li <lipeng321@xxxxxxxxxx>
Signed-off-by: Huazhong Tan <tanhuazhong@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index b2860087a7dc7..4b4d9de0a6bb5 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -1620,6 +1620,7 @@ static void hns3_remove(struct pci_dev *pdev)
hns3_disable_sriov(pdev);

hnae3_unregister_ae_dev(ae_dev);
+ pci_set_drvdata(pdev, NULL);
}

/**
--
2.20.1