]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
x86/apic: Handle zero vector gracefully in clear_vector_irq()
authorKeith Busch <keith.busch@intel.com>
Wed, 27 Apr 2016 20:22:32 +0000 (14:22 -0600)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 28 Apr 2016 07:53:06 +0000 (09:53 +0200)
If x86_vector_alloc_irq() fails x86_vector_free_irqs() is invoked to cleanup
the already allocated vectors. This subsequently calls clear_vector_irq().

The failed irq has no vector assigned, which triggers the BUG_ON(!vector) in
clear_vector_irq().

We cannot suppress the call to x86_vector_free_irqs() for the failed
interrupt, because the other data related to this irq must be cleaned up as
well. So calling clear_vector_irq() with vector == 0 is legitimate.

Remove the BUG_ON and return if vector is zero,

[ tglx: Massaged changelog ]

Fixes: b5dc8e6c21e7 "x86/irq: Use hierarchical irqdomain to manage CPU interrupt vectors"
Signed-off-by: Keith Busch <keith.busch@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/apic/vector.c

index ad59d70bcb1a6109742773e5f69a7235bca712f5..ef495511f019f0a899325d6a28ed5da98e1c939e 100644 (file)
@@ -256,7 +256,8 @@ static void clear_irq_vector(int irq, struct apic_chip_data *data)
        struct irq_desc *desc;
        int cpu, vector;
 
-       BUG_ON(!data->cfg.vector);
+       if (!data->cfg.vector)
+               return;
 
        vector = data->cfg.vector;
        for_each_cpu_and(cpu, data->domain, cpu_online_mask)