DMA Engine development
 help / color / mirror / Atom feed
* dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()
@ 2018-06-28  6:27 Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2018-06-28  6:27 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Zhangfei Gao, dmaengine, kernel-janitors

On 22-06-18, 14:15, Dan Carpenter wrote:
> The d->chans[] array has d->dma_requests elements so the > should be
> >= here.

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread
* dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate()
@ 2018-06-22 11:15 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2018-06-22 11:15 UTC (permalink / raw)
  To: Vinod Koul, Zhangfei Gao; +Cc: dmaengine, kernel-janitors

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

Fixes: 8e6152bc660e ("dmaengine: Add hisilicon k3 DMA engine driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
index fa31cccbe04f..6bfa217ed6d0 100644
--- a/drivers/dma/k3dma.c
+++ b/drivers/dma/k3dma.c
@@ -794,7 +794,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] 2+ messages in thread

end of thread, other threads:[~2018-06-28  6:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-28  6:27 dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate() Vinod Koul
  -- strict thread matches above, loose matches on Subject: below --
2018-06-22 11:15 Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox