linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: edma: Reject slave configs using a buswidth of 8 and larger
@ 2017-09-17 14:25 Stefan Brüns
  2017-09-21 17:17 ` Vinod Koul
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Brüns @ 2017-09-17 14:25 UTC (permalink / raw)
  To: dmaengine; +Cc: Vinod Koul, linux-kernel, Dan Williams

The driver would happily accept buswidth of 16/32/64 bytes and program
garbage to its registers.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
 drivers/dma/edma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 3879f80a4815..c944ea339425 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -887,8 +887,8 @@ static int edma_slave_config(struct dma_chan *chan,
 {
 	struct edma_chan *echan = to_edma_chan(chan);
 
-	if (cfg->src_addr_width == DMA_SLAVE_BUSWIDTH_8_BYTES ||
-	    cfg->dst_addr_width == DMA_SLAVE_BUSWIDTH_8_BYTES)
+	if (cfg->src_addr_width >= DMA_SLAVE_BUSWIDTH_8_BYTES ||
+	    cfg->dst_addr_width >= DMA_SLAVE_BUSWIDTH_8_BYTES)
 		return -EINVAL;
 
 	memcpy(&echan->cfg, cfg, sizeof(echan->cfg));
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-22  8:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-17 14:25 [PATCH] dmaengine: edma: Reject slave configs using a buswidth of 8 and larger Stefan Brüns
2017-09-21 17:17 ` Vinod Koul
2017-09-21 18:29   ` Peter Ujfalusi
2017-09-22  6:16     ` Peter Ujfalusi
2017-09-22  8:43       ` Vinod Koul

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).