Re: [PATCH 1/3] dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions

2021-02-15 Thread Andy Shevchenko
On Sun, Feb 14, 2021 at 3:22 PM Dejin Zheng  wrote:
>
> 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")

Same as per others. This does not fix anything, because there is no issue.
If you want to have it better, introduce a pcim_alloc_irq_vectors() to
show that it's managed.


-- 
With Best Regards,
Andy Shevchenko


[PATCH 1/3] dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions

2021-02-14 Thread Dejin Zheng
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 
---
 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