提交 f3817e77 编写于 作者: D Dan Carpenter 提交者: Vinod Koul

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: 2e041c94 ('dmaengine: sirf: enable generic dt binding for dma channels')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NBarry Song <Baohua.Song@csr.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 2dda47d1
...@@ -666,7 +666,7 @@ static struct dma_chan *of_dma_sirfsoc_xlate(struct of_phandle_args *dma_spec, ...@@ -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; struct sirfsoc_dma *sdma = ofdma->of_dma_data;
unsigned int request = dma_spec->args[0]; unsigned int request = dma_spec->args[0];
if (request > SIRFSOC_DMA_CHANNELS) if (request >= SIRFSOC_DMA_CHANNELS)
return NULL; return NULL;
return dma_get_slave_channel(&sdma->channels[request].chan); return dma_get_slave_channel(&sdma->channels[request].chan);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册