Skip to content

Commit

Permalink
net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_…
Browse files Browse the repository at this point in the history
…probe()

[ Upstream commit 0807ce0 ]

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>
  • Loading branch information
Yang Yingliang authored and gregkh committed May 25, 2022
1 parent d4c6e5c commit 0ae23a1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,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__);
Expand Down Expand Up @@ -227,8 +227,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)
Expand Down

0 comments on commit 0ae23a1

Please sign in to comment.