Commit 0dec63ba authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

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

This patch fixes an array overflow found by the Coverity checker.
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 390725c3
...@@ -94,8 +94,8 @@ static void ...@@ -94,8 +94,8 @@ static void
pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma) pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma)
{ {
int i = 0; int i = 0;
while (!(res->dma_resource[i].flags & IORESOURCE_UNSET) && while (i < PNP_MAX_DMA &&
i < PNP_MAX_DMA) !(res->dma_resource[i].flags & IORESOURCE_UNSET))
i++; i++;
if (i < PNP_MAX_DMA) { if (i < PNP_MAX_DMA) {
res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag
......
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