Skip to content

Commit

Permalink
dmaengine: sirf: off by one in of_dma_sirfsoc_xlate()
Browse files Browse the repository at this point in the history
The ">" here should be ">=" or we are one step beyond the end of the
sdma->channels[] array.

Fixes: 2e041c9 ('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>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Dan Carpenter authored and Vinod Koul committed Apr 16, 2014
1 parent 2dda47d commit f3817e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/sirf-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f3817e7

Please sign in to comment.