diff options
author | Adrian Bunk <bunk@stusta.de> | 2005-05-01 08:59:30 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 08:59:30 -0700 |
commit | 0dec63bab860cc60cc444faa0ac459f1b53545ff (patch) | |
tree | 3b07982063574ed27b1edd4ec1376b52ca7bbd76 /drivers/pnp | |
parent | 390725c36d220f5ca0c13b8927ac9c758ae1e4ad (diff) | |
download | talos-op-linux-0dec63bab860cc60cc444faa0ac459f1b53545ff.tar.gz talos-op-linux-0dec63bab860cc60cc444faa0ac459f1b53545ff.zip |
[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>
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/pnpacpi/rsparser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index c0ddb1eb8c4d..dd61e09029b1 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c @@ -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 |