1
0
Fork 0

dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()

[ Upstream commit c4c2b7644c ]

The d->chans[] array has d->dma_requests elements so the > should be
>= here.

Fixes: 8e6152bc66 ("dmaengine: Add hisilicon k3 DMA engine driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
Dan Carpenter 2018-06-22 14:15:47 +03:00 committed by Greg Kroah-Hartman
parent 4cea08638e
commit bb2b7243e3
1 changed files with 1 additions and 1 deletions

View File

@ -787,7 +787,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
struct k3_dma_dev *d = ofdma->of_dma_data;
unsigned int request = dma_spec->args[0];
if (request > d->dma_requests)
if (request >= d->dma_requests)
return NULL;
return dma_get_slave_channel(&(d->chans[request].vc.chan));