Skip to content

Commit

Permalink
[PATCH] i386: handle a negative return value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adrian Bunk authored and Andi Kleen committed Dec 7, 2006
1 parent e1cccf4 commit 956fb53
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion arch/i386/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2179,9 +2179,15 @@ static inline void unlock_ExtINT_logic(void)
unsigned char save_control, save_freq_select;

pin = find_isa_irq_pin(8, mp_INT);
if (pin == -1) {
WARN_ON_ONCE(1);
return;
}
apic = find_isa_irq_apic(8, mp_INT);
if (pin == -1)
if (apic == -1) {
WARN_ON_ONCE(1);
return;
}

entry0 = ioapic_read_entry(apic, pin);
clear_IO_APIC_pin(apic, pin);
Expand Down

0 comments on commit 956fb53

Please sign in to comment.