devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] dma: cppi41: off by one in desc_to_chan()
@ 2013-08-23  9:30 Dan Carpenter
  2013-08-26  8:32 ` Vinod Koul
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2013-08-23  9:30 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Dan Williams, Grant Likely, Rob Herring, devicetree,
	kernel-janitors

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;

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

* Re: [patch] dma: cppi41: off by one in desc_to_chan()
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Vinod Koul @ 2013-08-26  8:32 UTC (permalink / raw)
  To: Dan Carpenter, Felipe Balbi
  Cc: Dan Williams, Grant Likely, Rob Herring, devicetree,
	kernel-janitors

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;

-- 

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

* [patch] dma: cppi41: off by one in desc_to_chan()
  2013-08-26  8:32 ` Vinod Koul
@ 2013-08-28 10:48   ` Dan Carpenter
  2013-08-28 22:46     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2013-08-28 10:48 UTC (permalink / raw)
  To: Vinod Koul, Greg Kroah-Hartman
  Cc: Dan Williams, Grant Likely, Rob Herring, devicetree,
	kernel-janitors, linux-usb

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;


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

* Re: [patch] dma: cppi41: off by one in desc_to_chan()
  2013-08-28 10:48   ` Dan Carpenter
@ 2013-08-28 22:46     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2013-08-28 22:46 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Vinod Koul, Dan Williams, Grant Likely, Rob Herring, devicetree,
	kernel-janitors, linux-usb

On Wed, Aug 28, 2013 at 01:48:44PM +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>
> Acked-by: Vinod Koul <vinod.koul@intel.com>
> ---
> Resending to Greg and the USB people because Vinod says this goes
> through the USB tree.

Really?  Ok, that seems odd, but whatever...


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

end of thread, other threads:[~2013-08-28 22:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-08-28 22:46     ` Greg Kroah-Hartman

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).