linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasyl Gomonovych <gomonovych@gmail.com>
To: dan.j.williams@intel.com, vinod.koul@intel.com,
	dmaengine@vger.kernel.org, gomonovych@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] dmaengine: cppi41: Fix channel queues array size check
Date: Thu, 21 Dec 2017 16:53:04 +0100	[thread overview]
Message-ID: <1513871584-8783-1-git-send-email-gomonovych@gmail.com> (raw)

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

             reply	other threads:[~2017-12-21 15:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21 15:53 Vasyl Gomonovych [this message]
2017-12-22 12:17 ` [PATCH] dmaengine: cppi41: Fix channel queues array size check Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1513871584-8783-1-git-send-email-gomonovych@gmail.com \
    --to=gomonovych@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).