aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2005-05-01 11:59:30 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 11:59:30 -0400
commit0dec63bab860cc60cc444faa0ac459f1b53545ff (patch)
tree3b07982063574ed27b1edd4ec1376b52ca7bbd76 /drivers
parent390725c36d220f5ca0c13b8927ac9c758ae1e4ad (diff)
[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')
-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 c0ddb1eb8c4d..dd61e09029b1 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -94,8 +94,8 @@ static void
94pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma) 94pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma)
95{ 95{
96 int i = 0; 96 int i = 0;
97 while (!(res->dma_resource[i].flags & IORESOURCE_UNSET) && 97 while (i < PNP_MAX_DMA &&
98 i < PNP_MAX_DMA) 98 !(res->dma_resource[i].flags & IORESOURCE_UNSET))
99 i++; 99 i++;
100 if (i < PNP_MAX_DMA) { 100 if (i < PNP_MAX_DMA) {
101 res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag 101 res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag