x86, ioapic: Throw BUG instead of NULL dereference
[firefly-linux-kernel-4.4.55.git] / 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;