devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>, Felipe Balbi <balbi@ti.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: Re: [patch] dma: cppi41: off by one in desc_to_chan()
Date: Mon, 26 Aug 2013 14:02:20 +0530	[thread overview]
Message-ID: <20130826083220.GM2748@intel.com> (raw)
In-Reply-To: <20130823093056.GG31293@elgon.mountain>

On Fri, Aug 23, 2013 at 12:30:56PM +0300, Dan Carpenter wrote:
> 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>
This needs to go thru USB tree

Acked-by Vinod Koul <vinod.koul@intel.com>

~Vinod
> 
> 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;

-- 

  reply	other threads:[~2013-08-26  8:32 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 [this message]
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=20130826083220.GM2748@intel.com \
    --to=vinod.koul@intel.com \
    --cc=balbi@ti.com \
    --cc=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 \
    /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).