Skip to contentSkip to conversation

x86/HPET: fix oversight in 23033:84bacd800bf8

PATCH New Jan Beulich 1 participant 1 message Mar 15, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/HPET: fix oversight in 23033:84bacd800bf8

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

xen/arch/x86/hpet.c +2 -4
@@ -428,10 +428,8 @@ static unsigned int __init hpet_fsb_cap_
         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",

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

xen/arch/x86/hpet.c +2 -4
@@ -428,10 +428,8 @@ static unsigned int __init hpet_fsb_cap_
         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",

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel