dma: cppi41: off by one in desc_to_chan()
Subsystems (2)
PATCH 1/1 dma: cppi41: off by one in desc_to_chan()
The test here should be ">=" instead of ">". The cdd->chan_busy[] array has "ALLOC_DECS_NUM" elements.
drivers/dma/cppi41.c +1 -1
@@ -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;
Quoted 4 lines · Dan Carpenter
The test here should be ">=" instead of ">". The cdd->chan_busy[] array has "
ALLOC_DECS_NUM" elements.Signed-off-by Dan Carpenter <[email protected]>
This needs to go thru USB tree
Acked-by Vinod Koul <[email protected]>
~Vinod
Quoted 14 lines
drivers/dma/cppi41.c +1
-1@@ -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;
PATCH 1/1 dma: cppi41: off by one in desc_to_chan()
The test here should be ">=" instead of ">". The cdd->chan_busy[] array has "ALLOC_DECS_NUM" elements.
---
Resending to Greg and the USB people because Vinod says this goes through the USB tree.
drivers/dma/cppi41.c +1 -1
@@ -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;
Quoted 8 lines · Dan Carpenter
The test here should be ">=" instead of ">". The cdd->chan_busy[] array has "
ALLOC_DECS_NUM" elements.Signed-off-by Dan Carpenter <[email protected]>Acked-by Vinod Koul <[email protected]>---
Resending to Greg and the USB people because Vinod says this goes through the USB tree.
Really? Ok, that seems odd, but whatever...