* [2.6 patch] drivers/pnp/pnpbios/rsparser.c: fix an array overflow
@ 2005-04-09 18:03 Adrian Bunk
2005-04-11 2:25 ` Adam Belay
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2005-04-09 18:03 UTC (permalink / raw)
To: Andrew Morton; +Cc: ambx1, linux-kernel
This patch fixes an array overflow found by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
This patch was already sent on:
- 27 Mar 2005
--- linux-2.6.12-rc1-mm1-full/drivers/pnp/pnpbios/rsparser.c.old 2005-03-23 03:04:17.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/drivers/pnp/pnpbios/rsparser.c 2005-03-23 03:05:21.000000000 +0100
@@ -72,7 +72,9 @@
pnpbios_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) i++;
+ 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
if (dma == -1) {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6 patch] drivers/pnp/pnpbios/rsparser.c: fix an array overflow
2005-04-09 18:03 [2.6 patch] drivers/pnp/pnpbios/rsparser.c: fix an array overflow Adrian Bunk
@ 2005-04-11 2:25 ` Adam Belay
0 siblings, 0 replies; 3+ messages in thread
From: Adam Belay @ 2005-04-11 2:25 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Andrew Morton, linux-kernel
On Sat, Apr 09, 2005 at 08:03:52PM +0200, Adrian Bunk wrote:
> This patch fixes an array overflow found by the Coverity checker.
>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
>
Looks good.
Thanks,
Adam
^ permalink raw reply [flat|nested] 3+ messages in thread
* [2.6 patch] drivers/pnp/pnpbios/rsparser.c: fix an array overflow
@ 2005-03-27 20:30 Adrian Bunk
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2005-03-27 20:30 UTC (permalink / raw)
To: ambx1; +Cc: linux-kernel
This patch fixes an array overflow found by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.12-rc1-mm1-full/drivers/pnp/pnpbios/rsparser.c.old 2005-03-23 03:04:17.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/drivers/pnp/pnpbios/rsparser.c 2005-03-23 03:05:21.000000000 +0100
@@ -72,7 +72,9 @@
pnpbios_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) i++;
+ 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
if (dma == -1) {
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-04-11 2:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-09 18:03 [2.6 patch] drivers/pnp/pnpbios/rsparser.c: fix an array overflow Adrian Bunk
2005-04-11 2:25 ` Adam Belay
-- strict thread matches above, loose matches on Subject: below --
2005-03-27 20:30 Adrian Bunk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).