Commit b9e14be3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()

BugLink: https://bugs.launchpad.net/bugs/1792377

[ Upstream commit c4c2b764 ]

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

Fixes: 8e6152bc ("dmaengine: Add hisilicon k3 DMA engine driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent c44ed110
......@@ -660,7 +660,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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment