All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] dma: cppi41: off by one in desc_to_chan()
@ 2013-08-23  9:30 ` Dan Carpenter
  0 siblings, 0 replies; 8+ 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] 8+ messages in thread

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

Thread overview: 8+ 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-23  9:30 ` Dan Carpenter
2013-08-26  8:32 ` Vinod Koul
2013-08-26  8:44   ` Vinod Koul
2013-08-28 10:48   ` Dan Carpenter
2013-08-28 10:48     ` Dan Carpenter
2013-08-28 22:46     ` Greg Kroah-Hartman
2013-08-28 22:46       ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.