Commit 989ffc7b authored by Dan Carpenter's avatar Dan Carpenter Committed by 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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarPurna Chandra Mandal <purna.mandal@microchip.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment