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 <zhengdej...@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 via email to