Add missing call to 'pci_free_irq_vectors()'
Subsystems (4)
cover Add missing call to 'pci_free_irq_vectors()'
This patchset just for add missing call to 'pci_free_irq_vectors()' in the error handling path of the probe function, or in the remove function.
Dejin Zheng (3):
dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe
and remove functions
dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in
probe function
dmaengine: hisilicon: Add missing call to 'pci_free_irq_vectors()' in
probe function
drivers/dma/dw-edma/dw-edma-pcie.c | 15 +++++++++++---- drivers/dma/hisi_dma.c | 14 ++++++++++---- drivers/dma/hsu/pci.c | 5 ++++- 3 files changed, 25 insertions(+), 9 deletions(-)
Signature · 1 line
2.25.0
PATCH 1/3 dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions
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.
--- drivers/dma/hsu/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/dma/hsu/pci.c +4 -1
@@ -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[] = {
Signature · 1 line
2.25.0
Re: [PATCH 1/3] dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions
Quoted 6 lines · 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")
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.
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 2/3 dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in probe function
In reply to Dejin ZhengCall to 'pci_free_irq_vectors()' is missing in the error handling path of the probe function, So add it.
--- drivers/dma/dw-edma/dw-edma-pcie.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/dma/dw-edma/dw-edma-pcie.c +11 -4
@@ -185,24 +185,31 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,/* Validating if PCI interrupts were enabled */ if (!pci_dev_msi_enabled (pdev)) {pci_err (pdev,"enable interrupt failed\n" ); -return -EPERM ; + err = -EPERM ; + goto err_free_irq; } dw->irq =devm_kcalloc (dev, nr_irqs,sizeof (*dw->irq),GFP_KERNEL ); -if (!dw->irq) -return -ENOMEM ; +if (!dw->irq) { + err = -ENOMEM ; + goto err_free_irq; + }/* Starting eDMA driver */ err =dw_edma_probe (chip);if (err) {pci_err (pdev,"eDMA probe failed\n" ); -return err; + goto err_free_irq; }/* Saving data structure reference */ pci_set_drvdata (pdev, chip);return 0 ; + +err_free_irq: +pci_free_irq_vectors (pdev); +return err; }static void dw_edma_pcie_remove (struct pci_dev *pdev)
Signature · 1 line
2.25.0
RE: [PATCH 2/3] dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in probe function
Quoted 51 lines · Dejin Zheng
Call to '
pci_free_irq_vectors()' is missing in the error handling path of the probe function, So add it.Fixes 41aaff2a2ac01c5 ("dmaengine: Add Synopsys eDMA IP PCIe glue-logic")Signed-off-by Dejin Zheng <[email protected]>--- drivers/dma/dw-edma/dw-edma-pcie.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)drivers/dma/dw-edma/dw-edma-pcie.c +11
-4@@ -185,24 +185,31 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,/* Validating if PCI interrupts were enabled */ if (!pci_dev_msi_enabled (pdev)) {pci_err (pdev,"enable interrupt failed\n" ); -return -EPERM ; + err = -EPERM ; + goto err_free_irq; } dw->irq =devm_kcalloc (dev, nr_irqs,sizeof (*dw->irq),GFP_KERNEL ); -if (!dw->irq) -return -ENOMEM ; +if (!dw->irq) { + err = -ENOMEM ; + goto err_free_irq; + }/* Starting eDMA driver */ err =dw_edma_probe (chip);if (err) {pci_err (pdev,"eDMA probe failed\n" ); -return err; + goto err_free_irq; }/* Saving data structure reference */ pci_set_drvdata (pdev, chip);return 0 ; + +err_free_irq: +pci_free_irq_vectors (pdev); +return err; }static void dw_edma_pcie_remove (struct pci_dev *pdev)Signature · 1 line
2.25.0
Re: [PATCH 2/3] dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in probe function
Quoted 51 lines · Gustavo Pimentel
Quoted 48 lines · Dejin Zheng
Call to '
pci_free_irq_vectors()' is missing in the error handling path of the probe function, So add it.Fixes 41aaff2a2ac01c5 ("dmaengine: Add Synopsys eDMA IP PCIe glue-logic")Signed-off-by Dejin Zheng <[email protected]>--- drivers/dma/dw-edma/dw-edma-pcie.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)drivers/dma/dw-edma/dw-edma-pcie.c +11
-4@@ -185,24 +185,31 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,/* Validating if PCI interrupts were enabled */ if (!pci_dev_msi_enabled (pdev)) {pci_err (pdev,"enable interrupt failed\n" ); -return -EPERM ; + err = -EPERM ; + goto err_free_irq; } dw->irq =devm_kcalloc (dev, nr_irqs,sizeof (*dw->irq),GFP_KERNEL ); -if (!dw->irq) -return -ENOMEM ; +if (!dw->irq) { + err = -ENOMEM ; + goto err_free_irq; + }/* Starting eDMA driver */ err =dw_edma_probe (chip);if (err) {pci_err (pdev,"eDMA probe failed\n" ); -return err; + goto err_free_irq; }/* Saving data structure reference */ pci_set_drvdata (pdev, chip);return 0 ; + +err_free_irq: +pci_free_irq_vectors (pdev); +return err; }
Quoted 7 lines
Quoted 3 lines
drivers/dma/dw-edma/dw-edma-pcie.c +0
-0static void dw_edma_pcie_remove (struct pci_dev *pdev)Signature · 1 line
2.25.0Acked-by Gustavo Pimentel <[email protected]>
Gustavo, Thanks!
Dejin
PATCH 3/3 dmaengine: hisilicon: Add missing call to 'pci_free_irq_vectors()' in probe function
In reply to Dejin ZhengCall to 'pci_free_irq_vectors()' is missing in the error handling path of the probe function, So add it.
--- drivers/dma/hisi_dma.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/dma/hisi_dma.c +10 -4
@@ -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; }
Signature · 1 line
2.25.0