summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2005-05-01 08:59:30 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 08:59:30 -0700
commit0dec63bab860cc60cc444faa0ac459f1b53545ff (patch)
tree3b07982063574ed27b1edd4ec1376b52ca7bbd76
parent390725c36d220f5ca0c13b8927ac9c758ae1e4ad (diff)
downloadop-kernel-dev-0dec63bab860cc60cc444faa0ac459f1b53545ff.zip
op-kernel-dev-0dec63bab860cc60cc444faa0ac459f1b53545ff.tar.gz
[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>
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index c0ddb1e..dd61e09 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
OpenPOWER on IntegriCloud