* [patch 1/2] k3dma: off by one in k3_of_dma_simple_xlate()
@ 2016-10-12 6:00 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-10-12 6:00 UTC (permalink / raw)
To: kernel-janitors
The ->chans[] array has ->dma_requests elements so the check should be
>= instead of >. The ->chans[] array is allocated in k3_dma_probe()
Fixes: 8e6152bc660e ('dmaengine: Add hisilicon k3 DMA engine driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index 7c636c53..f17a8c0 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -792,7 +792,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));
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-10-12 6:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-12 6:00 [patch 1/2] k3dma: off by one in k3_of_dma_simple_xlate() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).