Skip to content

Commit

Permalink
[PATCH] drivers/pnp/pnpacpi/rsparser.c: fix an array overflow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adrian Bunk authored and Linus Torvalds committed May 1, 2005
1 parent 390725c commit 0dec63b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0dec63b

Please sign in to comment.