aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-12-06 20:14:11 -0500
committerAndi Kleen <andi@basil.nowhere.org>2006-12-06 20:14:11 -0500
commit956fb53197f82257974f1f9835485aeeef4510b3 (patch)
treecd52c05cfa4b11234eb307b6b1999cef3a25f138 /arch/i386
parente1cccf48b182dd743c3c83a4fdf8dc570a43b393 (diff)
[PATCH] i386: handle a negative return value
The Coverity checker noted that bad things might happen if find_isa_irq_apic() returned -1. [akpm@osdl.org: add debugging checks] Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <ak@suse.de> Acked-by: Ingo Molnar <mingo@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/io_apic.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 993150f206ed..7bfd6c3ec87d 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -2179,9 +2179,15 @@ static inline void unlock_ExtINT_logic(void)
2179 unsigned char save_control, save_freq_select; 2179 unsigned char save_control, save_freq_select;
2180 2180
2181 pin = find_isa_irq_pin(8, mp_INT); 2181 pin = find_isa_irq_pin(8, mp_INT);
2182 if (pin == -1) {
2183 WARN_ON_ONCE(1);
2184 return;
2185 }
2182 apic = find_isa_irq_apic(8, mp_INT); 2186 apic = find_isa_irq_apic(8, mp_INT);
2183 if (pin == -1) 2187 if (apic == -1) {
2188 WARN_ON_ONCE(1);
2184 return; 2189 return;
2190 }
2185 2191
2186 entry0 = ioapic_read_entry(apic, pin); 2192 entry0 = ioapic_read_entry(apic, pin);
2187 clear_IO_APIC_pin(apic, pin); 2193 clear_IO_APIC_pin(apic, pin);