Skip to contentSkip to conversation

x86: hpet: Fix bogus error check in hpet_assign_irq()

PATCH New Thomas Gleixner 1 participant 1 message Sep 28, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: hpet: Fix bogus error check in hpet_assign_irq()

create_irq() returns -1 if the interrupt allocation failed, but the code checks for irq == 0.

Use create_irq_nr() instead.

---
 arch/x86/kernel/hpet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/hpet.c +1 -1
Index: linux-2.6/arch/x86/kernel/hpet.c
===================================================================
@@ -506,7 +506,7 @@ static int hpet_assign_irq(struct hpet_d
 {
 	unsigned int irq;
 
-	irq = create_irq();
+	irq = create_irq_nr(0, -1);
 	if (!irq)
 		return -EINVAL;