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 3/3] dmaengine: hisilicon: Add missing call to 'pci_free_irq_vectors()' in probe function
Date: Sun, 14 Feb 2021 21:21:53 +0800 [thread overview]
Message-ID: <20210214132153.575350-4-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: e9f08b65250d73ab ("dmaengine: hisilicon: Add Kunpeng DMA engine support")
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
drivers/dma/hisi_dma.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c
index a259ee010e9b..9e894d7f5dab 100644
--- a/drivers/dma/hisi_dma.c
+++ b/drivers/dma/hisi_dma.c
@@ -553,7 +553,7 @@ static int hisi_dma_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ret = devm_add_action_or_reset(dev, hisi_dma_free_irq_vectors, pdev);
if (ret)
- return ret;
+ goto err_free_irq;
dma_dev = &hdma_dev->dma_dev;
dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
@@ -572,18 +572,24 @@ static int hisi_dma_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ret = hisi_dma_enable_hw_channels(hdma_dev);
if (ret < 0) {
dev_err(dev, "failed to enable hw channel!\n");
- return ret;
+ goto err_free_irq;
}
ret = devm_add_action_or_reset(dev, hisi_dma_disable_hw_channels,
hdma_dev);
if (ret)
- return ret;
+ goto err_free_irq;
ret = dmaenginem_async_device_register(dma_dev);
- if (ret < 0)
+ if (ret < 0) {
dev_err(dev, "failed to register device!\n");
+ goto err_free_irq;
+ }
+
+ return ret;
+err_free_irq:
+ pci_free_irq_vectors(pdev);
return ret;
}
--
2.25.0
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 ` [PATCH 2/3] dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in probe function Dejin Zheng
2021-02-15 9:45 ` Gustavo Pimentel
2021-02-15 12:46 ` Dejin Zheng
2021-02-14 13:21 ` Dejin Zheng [this message]
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-4-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).