x86/HPET: fix oversight in 23033:84bacd800bf8
authorJan Beulich <jbeulich@novell.com>
Tue, 15 Mar 2011 10:02:36 +0000 (10:02 +0000)
committerJan Beulich <jbeulich@novell.com>
Tue, 15 Mar 2011 10:02:36 +0000 (10:02 +0000)
Clearly for the adjusted BUG_ON()s to not yield false positives
num_chs_used must be incremented before setting up an IRQ (and
decremented back when the setup failed).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/hpet.c

index b5301c59c2bc7b9b0141614f08a7c4a273727fba..987a9ff8cedd63d901c601436b682e7584d5fe7e 100644 (file)
@@ -428,10 +428,8 @@ static unsigned int __init hpet_fsb_cap_lookup(void)
         ch->flags = 0;
         ch->idx = i;
 
-        if ( (ch->irq = hpet_assign_irq(num_chs_used)) < 0 )
-            continue;
-
-        num_chs_used++;
+        if ( (ch->irq = hpet_assign_irq(num_chs_used++)) < 0 )
+            num_chs_used--;
     }
 
     printk(XENLOG_INFO "HPET: %u timers (%u will be used for broadcast)\n",