Skip to contentSkip to conversation

x86: return value of domain_pirq_to_irq() is signed

PATCH New Jan Beulich 1 participant 1 message Jun 15, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: return value of domain_pirq_to_irq() is signed

That value can, for forcibly unbound PIRQs, validly be negative, and for the respective check to catch those cases (and prevent using these negative values as array index), the respective variables must be of signed type.

xen/arch/x86/irq.c +2 -2
@@ -887,7 +887,7 @@ static void __do_IRQ_guest(int irq)
 struct irq_desc *domain_spin_lock_irq_desc(
     struct domain *d, int pirq, unsigned long *pflags)
 {
-    unsigned int irq;
+    int irq;
     unsigned long flags;
     struct irq_desc *desc;
 
@@ -1054,7 +1054,7 @@ extern int ioapic_ack_new;
 static int pirq_acktype(struct domain *d, int pirq)
 {
     struct irq_desc  *desc;
-    unsigned int irq;
+    int irq;
 
     irq = domain_pirq_to_irq(d, pirq);
     if ( irq <= 0 )

That value can, for forcibly unbound PIRQs, validly be negative, and for the respective check to catch those cases (and prevent using these negative values as array index), the respective variables must be of signed type.

xen/arch/x86/irq.c +2 -2
@@ -887,7 +887,7 @@ static void __do_IRQ_guest(int irq)
 struct irq_desc *domain_spin_lock_irq_desc(
     struct domain *d, int pirq, unsigned long *pflags)
 {
-    unsigned int irq;
+    int irq;
     unsigned long flags;
     struct irq_desc *desc;
 
@@ -1054,7 +1054,7 @@ extern int ioapic_ack_new;
 static int pirq_acktype(struct domain *d, int pirq)
 {
     struct irq_desc  *desc;
-    unsigned int irq;
+    int irq;
 
     irq = domain_pirq_to_irq(d, pirq);
     if ( irq <= 0 )

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