diff options
author | Jean-Philippe Brucker <jean-philippe.brucker@arm.com> | 2017-06-01 20:22:01 +0200 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2017-06-02 08:19:44 +0200 |
commit | ebcdaee4cebb3a8d0d702ab5e9392373672ec1de (patch) | |
tree | 985c2ab8399d9af6ff94178f5491ad54ed16c136 /drivers | |
parent | rcar-dmac: fixup descriptor pointer for descriptor mode (diff) | |
download | linux-ebcdaee4cebb3a8d0d702ab5e9392373672ec1de.tar.xz linux-ebcdaee4cebb3a8d0d702ab5e9392373672ec1de.zip |
dmaengine: pl330: fix warning in pl330_remove
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/pl330.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 8b0da7fa520d..e90a7a0d760a 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -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); |