1
0
Fork 0

[PATCH] drivers/pnp/pnpacpi/rsparser.c: fix an array overflow

This patch fixes an array overflow found by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
hifive-unleashed-5.1
Adrian Bunk 2005-05-01 08:59:30 -07:00 committed by Linus Torvalds
parent 390725c36d
commit 0dec63bab8
1 changed files with 2 additions and 2 deletions

View File

@ -94,8 +94,8 @@ static void
pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma)
{
int i = 0;
while (!(res->dma_resource[i].flags & IORESOURCE_UNSET) &&
i < PNP_MAX_DMA)
while (i < PNP_MAX_DMA &&
!(res->dma_resource[i].flags & IORESOURCE_UNSET))
i++;
if (i < PNP_MAX_DMA) {
res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag