kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] dma: pl330: off by one in pl330_probe()
@ 2013-11-08  9:50 Dan Carpenter
  2013-11-13 13:32 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-11-08  9:50 UTC (permalink / raw)
  To: kernel-janitors

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>

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,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch 1/2] dma: pl330: off by one in pl330_probe()
  2013-11-08  9:50 [patch 1/2] dma: pl330: off by one in pl330_probe() Dan Carpenter
@ 2013-11-13 13:32 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2013-11-13 13:32 UTC (permalink / raw)
  To: kernel-janitors

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,

-- 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-13 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08  9:50 [patch 1/2] dma: pl330: off by one in pl330_probe() Dan Carpenter
2013-11-13 13:32 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).