aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-11-08 19:46:46 +0800
committerPaolo Abeni <pabeni@redhat.com>2022-11-10 11:03:00 +0100
commitfe5b3ce8b4377e543960220f539b989a927afd8a (patch)
tree9551fd33745808b83a5547b086af1c6508e51883 /drivers
parentstmmac: dwmac-loongson: fix missing pci_disable_msi() while module exiting (diff)
downloadlinux-dev-fe5b3ce8b4377e543960220f539b989a927afd8a.tar.xz
linux-dev-fe5b3ce8b4377e543960220f539b989a927afd8a.zip
stmmac: dwmac-loongson: fix missing pci_disable_device() in loongson_dwmac_probe()
Add missing pci_disable_device() in the error path in loongson_dwmac_probe(). Fixes: 30bba69d7db4 ("stmmac: pci: Add dwmac support for Loongson") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index 16915b4d9505..2d480bc49c51 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -97,7 +97,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
continue;
ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
if (ret)
- return ret;
+ goto err_disable_device;
break;
}
@@ -108,7 +108,8 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
phy_mode = device_get_phy_mode(&pdev->dev);
if (phy_mode < 0) {
dev_err(&pdev->dev, "phy_mode not found\n");
- return phy_mode;
+ ret = phy_mode;
+ goto err_disable_device;
}
plat->phy_interface = phy_mode;
@@ -149,6 +150,8 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
err_disable_msi:
pci_disable_msi(pdev);
+err_disable_device:
+ pci_disable_device(pdev);
return ret;
}