[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210214132153.575350-3-zhengdejin5@gmail.com>
Date: Sun, 14 Feb 2021 21:21:52 +0800
From: Dejin Zheng <zhengdejin5@...il.com>
To: gustavo.pimentel@...opsys.com, vkoul@...nel.org,
wangzhou1@...ilicon.com, ftoth@...londelft.nl,
andy.shevchenko@...il.com, qiuzhenfa@...ilicon.com,
dmaengine@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Dejin Zheng <zhengdejin5@...il.com>
Subject: [PATCH 2/3] dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in probe function
Call to 'pci_free_irq_vectors()' is missing in the error handling path
of the probe function, So add it.
Fixes: 41aaff2a2ac01c5 ("dmaengine: Add Synopsys eDMA IP PCIe glue-logic")
Signed-off-by: Dejin Zheng <zhengdejin5@...il.com>
---
drivers/dma/dw-edma/dw-edma-pcie.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
index 1eafc602e17e..c1e796bd3ee9 100644
--- a/drivers/dma/dw-edma/dw-edma-pcie.c
+++ b/drivers/dma/dw-edma/dw-edma-pcie.c
@@ -185,24 +185,31 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,
/* Validating if PCI interrupts were enabled */
if (!pci_dev_msi_enabled(pdev)) {
pci_err(pdev, "enable interrupt failed\n");
- return -EPERM;
+ err = -EPERM;
+ goto err_free_irq;
}
dw->irq = devm_kcalloc(dev, nr_irqs, sizeof(*dw->irq), GFP_KERNEL);
- if (!dw->irq)
- return -ENOMEM;
+ if (!dw->irq) {
+ err = -ENOMEM;
+ goto err_free_irq;
+ }
/* Starting eDMA driver */
err = dw_edma_probe(chip);
if (err) {
pci_err(pdev, "eDMA probe failed\n");
- return err;
+ goto err_free_irq;
}
/* Saving data structure reference */
pci_set_drvdata(pdev, chip);
return 0;
+
+err_free_irq:
+ pci_free_irq_vectors(pdev);
+ return err;
}
static void dw_edma_pcie_remove(struct pci_dev *pdev)
--
2.25.0
Powered by blists - more mailing lists