提交 989ffc7b 编写于 作者: D Dan Carpenter 提交者: Mark Brown

spi: pic32-sqi: silence array overflow warning

We read one element beyond the end of the array when we access
"rdesc[i + 1]" so it causes a static checker warning.  It's harmless
because we write over it again on the next line.  But let's just silence
the warning.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NPurna Chandra Mandal <purna.mandal@microchip.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 3270ac23
......@@ -537,7 +537,7 @@ static int ring_desc_ring_alloc(struct pic32_sqi *sqi)
}
/* Prepare BD: chain to next BD(s) */
for (i = 0, rdesc = sqi->ring; i < PESQI_BD_COUNT; i++)
for (i = 0, rdesc = sqi->ring; i < PESQI_BD_COUNT - 1; i++)
bd[i].bd_nextp = rdesc[i + 1].bd_dma;
bd[PESQI_BD_COUNT - 1].bd_nextp = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册