Skip to content

Commit c4c2b76

Browse files
Dan Carpentervinodkoul
Dan Carpenter
authored andcommitted
dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()
The d->chans[] array has d->dma_requests elements so the > should be >= here. Fixes: 8e6152b ("dmaengine: Add hisilicon k3 DMA engine driver") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
1 parent e3f329c commit c4c2b76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/k3dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
794794
struct k3_dma_dev *d = ofdma->of_dma_data;
795795
unsigned int request = dma_spec->args[0];
796796

797-
if (request > d->dma_requests)
797+
if (request >= d->dma_requests)
798798
return NULL;
799799

800800
return dma_get_slave_channel(&(d->chans[request].vc.chan));

0 commit comments

Comments
 (0)