summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-05-10 11:13:16 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-25 09:10:41 +0200
commit7234b1190dd1310557eb055f231844f511cf958a (patch)
treef056d2bf2005840465d3e71e36b9a869a4cd685b /drivers/net/ethernet
parent9eca6bd30a2644ee0842f4c2183ee83101204572 (diff)
downloadlinux-stable-7234b1190dd1310557eb055f231844f511cf958a.tar.gz
linux-stable-7234b1190dd1310557eb055f231844f511cf958a.tar.bz2
linux-stable-7234b1190dd1310557eb055f231844f511cf958a.zip
net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe()
[ Upstream commit 0807ce0b010418a191e0e4009803b2d74c3245d5 ] Switch to using pcim_enable_device() to avoid missing pci_disable_device(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220510031316.1780409-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index cc1e887e47b5..3dec109251ad 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -261,7 +261,7 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
return -ENOMEM;
/* Enable pci device */
- ret = pci_enable_device(pdev);
+ ret = pcim_enable_device(pdev);
if (ret) {
dev_err(&pdev->dev, "%s: ERROR: failed to enable device\n",
__func__);
@@ -313,8 +313,6 @@ static void stmmac_pci_remove(struct pci_dev *pdev)
pcim_iounmap_regions(pdev, BIT(i));
break;
}
-
- pci_disable_device(pdev);
}
static int __maybe_unused stmmac_pci_suspend(struct device *dev)