From: Dan Carpenter <dan.carpenter@oracle.com>
To: Vinod Koul <vinod.koul@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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,
linux-usb@vger.kernel.org
Subject: [patch] dma: cppi41: off by one in desc_to_chan()
Date: Wed, 28 Aug 2013 13:48:44 +0300 [thread overview]
Message-ID: <20130828104844.GG19256@mwanda> (raw)
In-Reply-To: <20130826083220.GM2748@intel.com>
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>
Acked-by: Vinod Koul <vinod.koul@intel.com>
---
Resending to Greg and the USB people because Vinod says this goes
through the USB tree.
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 prev parent reply other threads:[~2013-08-28 10:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 9:30 [patch] dma: cppi41: off by one in desc_to_chan() Dan Carpenter
2013-08-26 8:32 ` Vinod Koul
2013-08-28 10:48 ` Dan Carpenter [this message]
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=20130828104844.GG19256@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devicetree@vger.kernel.org \
--cc=djbw@fb.com \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-usb@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).