From: Dejin Zheng <zhengdejin5@gmail.com>
To: gustavo.pimentel@synopsys.com, vkoul@kernel.org,
wangzhou1@hisilicon.com, ftoth@exalondelft.nl,
andy.shevchenko@gmail.com, qiuzhenfa@hisilicon.com,
dmaengine@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Dejin Zheng <zhengdejin5@gmail.com>
Subject: [PATCH 2/3] dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in probe function
Date: Sun, 14 Feb 2021 21:21:52 +0800 [thread overview]
Message-ID: <20210214132153.575350-3-zhengdejin5@gmail.com> (raw)
In-Reply-To: <20210214132153.575350-1-zhengdejin5@gmail.com>
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@gmail.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
next prev parent reply other threads:[~2021-02-14 13:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-14 13:21 [PATCH 0/3] Add missing call to 'pci_free_irq_vectors()' Dejin Zheng
2021-02-14 13:21 ` [PATCH 1/3] dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions Dejin Zheng
2021-02-15 13:25 ` Andy Shevchenko
2021-02-14 13:21 ` Dejin Zheng [this message]
2021-02-15 9:45 ` [PATCH 2/3] dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in probe function Gustavo Pimentel
2021-02-15 12:46 ` Dejin Zheng
2021-02-14 13:21 ` [PATCH 3/3] dmaengine: hisilicon: " Dejin Zheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210214132153.575350-3-zhengdejin5@gmail.com \
--to=zhengdejin5@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=dmaengine@vger.kernel.org \
--cc=ftoth@exalondelft.nl \
--cc=gustavo.pimentel@synopsys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=qiuzhenfa@hisilicon.com \
--cc=vkoul@kernel.org \
--cc=wangzhou1@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).