Skip to content

Commit 989ffc7

Browse files
Dan Carpenterbroonie
authored andcommitted
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: Dan Carpenter <[email protected]> Reviewed-by: Purna Chandra Mandal <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 3270ac2 commit 989ffc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-pic32-sqi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ static int ring_desc_ring_alloc(struct pic32_sqi *sqi)
537537
}
538538

539539
/* Prepare BD: chain to next BD(s) */
540-
for (i = 0, rdesc = sqi->ring; i < PESQI_BD_COUNT; i++)
540+
for (i = 0, rdesc = sqi->ring; i < PESQI_BD_COUNT - 1; i++)
541541
bd[i].bd_nextp = rdesc[i + 1].bd_dma;
542542
bd[PESQI_BD_COUNT - 1].bd_nextp = 0;
543543

0 commit comments

Comments
 (0)