]> nv-tegra.nvidia Code Review - linux-3.10.git/commitdiff
x86, ioapic: Throw BUG instead of NULL dereference
authorCyrill Gorcunov <gorcunov@openvz.org>
Sat, 1 Aug 2009 07:48:00 +0000 (11:48 +0400)
committerIngo Molnar <mingo@elte.hu>
Wed, 5 Aug 2009 08:30:50 +0000 (10:30 +0200)
Instead of plain NULL deref we better throw error
message with a backtrace. Actually we need more
gracious error handling here. Meanwhile leave it
as is.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: yinghai@kernel.org
LKML-Reference: <20090801075435.769301745@openvz.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/apic/io_apic.c

index ffd8fdfcbe4c4392b64f43342d38d54676e1c9c9..2a145d3a8375411e6430635bd49433187be204a1 100644 (file)
@@ -503,6 +503,10 @@ static void add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin
        }
 
        entry = get_one_free_irq_2_pin(node);
+       if (!entry) {
+               printk(KERN_ERR "can not alloc irq_pin_list\n");
+               BUG_ON(1);
+       }
        entry->apic = apic;
        entry->pin = pin;