* [PATCH 1/1] ia64: pci_br, fix infinite loop
@ 2009-08-25 18:54 Jiri Slaby
0 siblings, 0 replies; only message in thread
From: Jiri Slaby @ 2009-08-25 18:54 UTC (permalink / raw)
To: tony.luck; +Cc: linux-ia64, linux-kernel, Jiri Slaby, Fenghua Yu
When
* there is almost out of ates
* one asks for more than one ate
* there are some available at the end of ate array
then the inner for loop will end without incrementing 'index'. This
means the outer loop will start at the same point finding it's available
and runs the inner loop again from the same index. This repeats forever.
Hence make sure we check we were at the end of ate array and return
an error in such case.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Found-by: Jeff Mahoney <jeffm@novell.com>
---
arch/ia64/sn/pci/pcibr/pcibr_ate.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_ate.c b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
index 239b3ce..5bc34ea 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_ate.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
@@ -54,6 +54,8 @@ static int find_free_ate(struct ate_resource *ate_resource, int start,
break;
}
}
+ if (i >= ate_resource->num_ate)
+ return -1;
} else
index++; /* Try next ate */
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-25 18:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-25 18:54 [PATCH 1/1] ia64: pci_br, fix infinite loop Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox