diff mbox

[1/2] dma: pl330: off by one in pl330_probe()

Message ID 20131108095024.GH27977@elgon.mountain (mailing list archive)
State Accepted
Delegated to: Vinod Koul
Headers show

Commit Message

Dan Carpenter Nov. 8, 2013, 9:50 a.m. UTC
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>

--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Vinod Koul Nov. 13, 2013, 1:20 p.m. UTC | #1
On Fri, Nov 08, 2013 at 12:50:24PM +0300, Dan Carpenter wrote:
> 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.
Applied both

Thanks
~Vinod

> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index 4b2583c..4af4b0c 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -2926,7 +2926,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,
diff mbox

Patch

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 4b2583c..4af4b0c 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2926,7 +2926,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,