linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 1/3] dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions
Date: Sun, 14 Feb 2021 21:21:51 +0800	[thread overview]
Message-ID: <20210214132153.575350-2-zhengdejin5@gmail.com> (raw)
In-Reply-To: <20210214132153.575350-1-zhengdejin5@gmail.com>

Call to 'pci_free_irq_vectors()' are missing both in the error handling
path of the probe function, and in the remove function.
Add them.

Fixes: e9bb8a9df316a2 ("dmaengine: hsu: pci: switch to new API for IRQ allocation")
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
 drivers/dma/hsu/pci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/hsu/pci.c b/drivers/dma/hsu/pci.c
index 9045a6f7f589..b335e2ef795b 100644
--- a/drivers/dma/hsu/pci.c
+++ b/drivers/dma/hsu/pci.c
@@ -89,7 +89,7 @@ static int hsu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	ret = hsu_dma_probe(chip);
 	if (ret)
-		return ret;
+		goto err_irq_vectors;
 
 	ret = request_irq(chip->irq, hsu_pci_irq, 0, "hsu_dma_pci", chip);
 	if (ret)
@@ -112,6 +112,8 @@ static int hsu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 err_register_irq:
 	hsu_dma_remove(chip);
+err_irq_vectors:
+	pci_free_irq_vectors(pdev);
 	return ret;
 }
 
@@ -121,6 +123,7 @@ static void hsu_pci_remove(struct pci_dev *pdev)
 
 	free_irq(chip->irq, chip);
 	hsu_dma_remove(chip);
+	pci_free_irq_vectors(pdev);
 }
 
 static const struct pci_device_id hsu_pci_id_table[] = {
-- 
2.25.0


  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 ` Dejin Zheng [this message]
2021-02-15 13:25   ` [PATCH 1/3] dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions 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 ` [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-2-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).