public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] dmaengine: sirf: off by one in of_dma_sirfsoc_xlate()
@ 2014-04-03  7:29 Dan Carpenter
  2014-04-04  4:52 ` Barry Song
  2014-04-16  6:42 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2014-04-03  7:29 UTC (permalink / raw)
  To: kernel-janitors

The ">" here should be ">=" or we are one step beyond the end of the
sdma->channels[] array.

Fixes: 2e041c94628c ('dmaengine: sirf: enable generic dt binding for dma channels')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c
index a1bd829..03f7820 100644
--- a/drivers/dma/sirf-dma.c
+++ b/drivers/dma/sirf-dma.c
@@ -666,7 +666,7 @@ static struct dma_chan *of_dma_sirfsoc_xlate(struct of_phandle_args *dma_spec,
 	struct sirfsoc_dma *sdma = ofdma->of_dma_data;
 	unsigned int request = dma_spec->args[0];
 
-	if (request > SIRFSOC_DMA_CHANNELS)
+	if (request >= SIRFSOC_DMA_CHANNELS)
 		return NULL;
 
 	return dma_get_slave_channel(&sdma->channels[request].chan);

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

* Re: [patch] dmaengine: sirf: off by one in of_dma_sirfsoc_xlate()
  2014-04-03  7:29 [patch] dmaengine: sirf: off by one in of_dma_sirfsoc_xlate() Dan Carpenter
@ 2014-04-04  4:52 ` Barry Song
  2014-04-16  6:42 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Barry Song @ 2014-04-04  4:52 UTC (permalink / raw)
  To: kernel-janitors

2014-04-03 15:29 GMT+08:00 Dan Carpenter <dan.carpenter@oracle.com>:
> The ">" here should be ">=" or we are one step beyond the end of the
> sdma->channels[] array.
>
> Fixes: 2e041c94628c ('dmaengine: sirf: enable generic dt binding for dma channels')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>

Acked-by: Barry Song <Baohua.Song@csr.com>

> diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c
> index a1bd829..03f7820 100644
> --- a/drivers/dma/sirf-dma.c
> +++ b/drivers/dma/sirf-dma.c
> @@ -666,7 +666,7 @@ static struct dma_chan *of_dma_sirfsoc_xlate(struct of_phandle_args *dma_spec,
>         struct sirfsoc_dma *sdma = ofdma->of_dma_data;
>         unsigned int request = dma_spec->args[0];
>
> -       if (request > SIRFSOC_DMA_CHANNELS)
> +       if (request >= SIRFSOC_DMA_CHANNELS)
>                 return NULL;
>
>         return dma_get_slave_channel(&sdma->channels[request].chan);

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

* Re: [patch] dmaengine: sirf: off by one in of_dma_sirfsoc_xlate()
  2014-04-03  7:29 [patch] dmaengine: sirf: off by one in of_dma_sirfsoc_xlate() Dan Carpenter
  2014-04-04  4:52 ` Barry Song
@ 2014-04-16  6:42 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2014-04-16  6:42 UTC (permalink / raw)
  To: kernel-janitors

On Thu, Apr 03, 2014 at 10:29:33AM +0300, Dan Carpenter wrote:
> The ">" here should be ">=" or we are one step beyond the end of the
> sdma->channels[] array.
> 
> Fixes: 2e041c94628c ('dmaengine: sirf: enable generic dt binding for dma channels')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks

-- 
~Vinod

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

end of thread, other threads:[~2014-04-16  6:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03  7:29 [patch] dmaengine: sirf: off by one in of_dma_sirfsoc_xlate() Dan Carpenter
2014-04-04  4:52 ` Barry Song
2014-04-16  6:42 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox