xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: fix off-by-one error in find_unbound_irq
@ 2010-02-26 10:59 Ian Campbell
  2010-02-26 11:22 ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2010-02-26 10:59 UTC (permalink / raw)
  To: xen-devel; +Cc: Jeremy Fitzhardinge, Ian Campbell, Konrad Rzeszutek Wilk

e459de95 "Find an unbound irq number in reverse order (high to low)" introduced
an off by one error which would cause repeated allocations of the nr_irq'th IRQ
if there are no spare interrupts (i.e. get_nr_hw_irqs() == nr_irqs).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
---
 drivers/xen/events.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 99f2b2a..5c64e1d 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -377,7 +377,7 @@ static int find_unbound_irq(void)
 		if (irq_info[irq].type == IRQT_UNBOUND)
 			break;
 
-	if (irq == start || irq == nr_irqs)
+	if (irq == start || irq == nr_irqs - 1)
 		panic("No available IRQ to bind to: increase nr_irqs!\n");
 
 	desc = irq_to_desc_alloc_node(irq, 0);
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-01 13:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-26 10:59 [PATCH] xen: fix off-by-one error in find_unbound_irq Ian Campbell
2010-02-26 11:22 ` Ian Campbell
2010-02-26 20:13   ` Jeremy Fitzhardinge
2010-02-26 21:21     ` Ian Campbell
2010-03-01 13:07       ` Ian Campbell

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).