linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] i386: more ioapic checks
@ 2006-12-18  7:06 Chuck Ebbert
  0 siblings, 0 replies; only message in thread
From: Chuck Ebbert @ 2006-12-18  7:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Andi Kleen, Linus Torvalds

Coverity reports apic numbers are being passed to functions without
checking to see if they are legal.

(This is Kernel Bugzilla #6188.)

Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>

--- 2.6.20-rc1-32.orig/arch/i386/kernel/io_apic.c
+++ 2.6.20-rc1-32/arch/i386/kernel/io_apic.c
@@ -2265,13 +2265,17 @@ static inline void __init check_timer(vo
 				clear_IO_APIC_pin(0, pin1);
 			return;
 		}
-		clear_IO_APIC_pin(apic1, pin1);
+		if (apic1 == -1)
+			WARN_ON_ONCE(1);
+		else
+			clear_IO_APIC_pin(apic1, pin1);
+
 		printk(KERN_ERR "..MP-BIOS bug: 8254 timer not connected to "
 				"IO-APIC\n");
 	}
 
 	printk(KERN_INFO "...trying to set up timer (IRQ0) through the 8259A ... ");
-	if (pin2 != -1) {
+	if (pin2 != -1 && apic2 != -1) {
 		printk("\n..... (found pin %d) ...", pin2);
 		/*
 		 * legacy devices should be connected to IO APIC #0
-- 
MBTI: IXTP

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-12-18  7:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-18  7:06 [patch] i386: more ioapic checks Chuck Ebbert

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