linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: cppi41: Fix channel queues array size check
@ 2017-12-21 15:53 Vasyl Gomonovych
  2017-12-22 12:17 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Vasyl Gomonovych @ 2017-12-21 15:53 UTC (permalink / raw)
  To: dan.j.williams, vinod.koul, dmaengine, gomonovych; +Cc: linux-kernel

The test should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
 drivers/dma/cppi41.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index f7e965f63274..d9bee65a18a4 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -934,7 +934,7 @@ static bool cpp41_dma_filter_fn(struct dma_chan *chan, void *param)
 
 	BUILD_BUG_ON(ARRAY_SIZE(am335x_usb_queues_rx) !=
 		     ARRAY_SIZE(am335x_usb_queues_tx));
-	if (WARN_ON(cchan->port_num > ARRAY_SIZE(am335x_usb_queues_rx)))
+	if (WARN_ON(cchan->port_num >= ARRAY_SIZE(am335x_usb_queues_rx)))
 		return false;
 
 	cchan->q_num = queues[cchan->port_num].submit;
-- 
1.9.1

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

* Re: [PATCH] dmaengine: cppi41: Fix channel queues array size check
  2017-12-21 15:53 [PATCH] dmaengine: cppi41: Fix channel queues array size check Vasyl Gomonovych
@ 2017-12-22 12:17 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2017-12-22 12:17 UTC (permalink / raw)
  To: Vasyl Gomonovych; +Cc: Williams, Dan J, dmaengine, linux-kernel

On Thu, Dec 21, 2017 at 09:23:04PM +0530, Vasyl Gomonovych wrote:
> The test should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().

Applied, thanks

-- 
~Vinod

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

end of thread, other threads:[~2017-12-22 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-21 15:53 [PATCH] dmaengine: cppi41: Fix channel queues array size check Vasyl Gomonovych
2017-12-22 12:17 ` 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).