diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2013-09-10 16:40:34 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-09-10 16:40:34 +0200 |
commit | ef0ea8c2bbb3718df1dee8f15ff3206bf592b253 (patch) | |
tree | 91a4f346622062b8e3b4aeae752ded99345cc5ad /xen | |
parent | 48d50de8e086e6669979889fb58dbf1092d10347 (diff) | |
download | xen-ef0ea8c2bbb3718df1dee8f15ff3206bf592b253.tar.gz xen-ef0ea8c2bbb3718df1dee8f15ff3206bf592b253.tar.bz2 xen-ef0ea8c2bbb3718df1dee8f15ff3206bf592b253.zip |
x86/ioapic: avoid trying to access the -1th ioapic
Discovered by Coverity, CID 1055743
Depending on the contents of the mp_irqs/mp_ioapics from the MP table,
find_isa_irq_apic() might return -1, at which point calling
ioapic_read_entry() with it is bad.
In addition to bailing if pin is -1, bail if apic is -1.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen')
-rw-r--r-- | xen/arch/x86/io_apic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 048c61cc9b..5512cd591f 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -1828,7 +1828,7 @@ static void __init unlock_ExtINT_logic(void) pin = find_isa_irq_pin(8, mp_INT); apic = find_isa_irq_apic(8, mp_INT); - if (pin == -1) + if ( pin == -1 || apic == -1 ) return; entry0 = ioapic_read_entry(apic, pin, 0); |