From: Dan Carpenter <dan.carpenter@oracle.com>
To: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <djbw@fb.com>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <rob.herring@calxeda.com>,
devicetree@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] dma: cppi41: off by one in desc_to_chan()
Date: Fri, 23 Aug 2013 12:30:56 +0300 [thread overview]
Message-ID: <20130823093056.GG31293@elgon.mountain> (raw)
The test here should be ">=" instead of ">". The cdd->chan_busy[] array
has "ALLOC_DECS_NUM" elements.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index 5dcebca..7f6524c 100644
--- a/drivers/dma/cppi41.c
+++ b/drivers/dma/cppi41.c
@@ -241,7 +241,7 @@ static struct cppi41_channel *desc_to_chan(struct cppi41_dd *cdd, u32 desc)
}
desc_num = (desc - cdd->descs_phys) / sizeof(struct cppi41_desc);
- BUG_ON(desc_num > ALLOC_DECS_NUM);
+ BUG_ON(desc_num >= ALLOC_DECS_NUM);
c = cdd->chan_busy[desc_num];
cdd->chan_busy[desc_num] = NULL;
return c;
next reply other threads:[~2013-08-23 9:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 9:30 Dan Carpenter [this message]
2013-08-26 8:32 ` [patch] dma: cppi41: off by one in desc_to_chan() Vinod Koul
2013-08-28 10:48 ` Dan Carpenter
2013-08-28 22:46 ` Greg Kroah-Hartman
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=20130823093056.GG31293@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=devicetree@vger.kernel.org \
--cc=djbw@fb.com \
--cc=grant.likely@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--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).