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: 30bba69d7d ("stmmac: pci: Add dwmac support for Loongson")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Yang Yingliang 2022-11-08 19:46:46 +08:00 committed by Paolo Abeni
parent f2d45fdf9a
commit fe5b3ce8b4

View File

@ -97,7 +97,7 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id
continue; continue;
ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev)); ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
if (ret) if (ret)
return ret; goto err_disable_device;
break; 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); phy_mode = device_get_phy_mode(&pdev->dev);
if (phy_mode < 0) { if (phy_mode < 0) {
dev_err(&pdev->dev, "phy_mode not found\n"); dev_err(&pdev->dev, "phy_mode not found\n");
return phy_mode; ret = phy_mode;
goto err_disable_device;
} }
plat->phy_interface = phy_mode; 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: err_disable_msi:
pci_disable_msi(pdev); pci_disable_msi(pdev);
err_disable_device:
pci_disable_device(pdev);
return ret; return ret;
} }