dma: pl330: off by one in pl330_probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 8 Nov 2013 09:50:24 +0000 (12:50 +0300)
committerVinod Koul <vinod.koul@intel.com>
Wed, 13 Nov 2013 13:19:43 +0000 (18:49 +0530)
There are only AMBA_NR_IRQS (2) elements in adev->irq[].  This code
maybe works if the there is a zero directly after the array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/pl330.c

index 75328f9870d23fb0599466b35700e3bbd373c728..ebd23b036a6930955ae55c72e53dfd5eab4b5056 100644 (file)
@@ -2922,7 +2922,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 
        amba_set_drvdata(adev, pdmac);
 
-       for (i = 0; i <= AMBA_NR_IRQS; i++) {
+       for (i = 0; i < AMBA_NR_IRQS; i++) {
                irq = adev->irq[i];
                if (irq) {
                        ret = devm_request_irq(&adev->dev, irq,