summaryrefslogtreecommitdiff
path: root/drivers/dma/sirf-dma.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-04-03 11:29:33 +0400
committerVinod Koul <vinod.koul@intel.com>2014-04-16 10:29:24 +0400
commitf3817e777ca3a089381a5b2370fbb869c3bcce6f (patch)
tree64536afea5874a249b9d84ff0ef9b3cd2f618fd0 /drivers/dma/sirf-dma.c
parent2dda47d1a416750bf69eb11dd9b6607d18287b0c (diff)
downloadlinux-f3817e777ca3a089381a5b2370fbb869c3bcce6f.tar.xz
dmaengine: sirf: off by one in of_dma_sirfsoc_xlate()
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> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/sirf-dma.c')
-rw-r--r--drivers/dma/sirf-dma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c
index a1bd8298d55f..03f7820fa333 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);