Skip to content

Commit

Permalink
dmaengine: pl330: fix warning in pl330_remove
Browse files Browse the repository at this point in the history
When removing a device with less than 9 IRQs (AMBA_NR_IRQS), we'll get a
big WARN_ON from devres.c because pl330_remove calls devm_free_irqs for
unallocated irqs. Similarly to pl330_probe, check that IRQ number is
present before calling devm_free_irq.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Jean-Philippe Brucker authored and Vinod Koul committed Jun 2, 2017
1 parent 56b1770 commit ebcdaee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -3008,7 +3008,8 @@ static int pl330_remove(struct amba_device *adev)

for (i = 0; i < AMBA_NR_IRQS; i++) {
irq = adev->irq[i];
devm_free_irq(&adev->dev, irq, pl330);
if (irq)
devm_free_irq(&adev->dev, irq, pl330);
}

dma_async_device_unregister(&pl330->ddma);
Expand Down

0 comments on commit ebcdaee

Please sign in to comment.