lkml.org 
[lkml]   [2021]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions
Date
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
\
 
 \ /
  Last update: 2021-02-14 14:24    [W:0.090 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site