提交 2d17f7fb 编写于 作者: D Dan Carpenter 提交者: Greg Kroah-Hartman

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.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NVinod Koul <vinod.koul@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ff49896a
......@@ -242,7 +242,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册