]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 28 May 2017 02:43:49 +0000 (19:43 -0700)
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>
(cherry picked from commit 1bdb8970392a68489b469c3a330a1adb5ef61beb)

Orabug: 24515998,25975565

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Conflicts:
arch/x86/kernel/apic/vector.c

arch/x86/kernel/apic/vector.c

index 78497c2e90150caa23403e795e5e02b180a35c55..171f89adef597d3ad63c6326a887440ad0178f9d 100644 (file)
@@ -208,7 +208,10 @@ void clear_irq_vector(int irq, struct irq_cfg *cfg)
        unsigned long flags;
 
        raw_spin_lock_irqsave(&vector_lock, flags);
-       BUG_ON(!cfg->vector);
+       if (!cfg->vector) {
+               raw_spin_unlock_irqrestore(&vector_lock, flags);
+               return;
+       }
 
        vector = cfg->vector;
        for_each_cpu_and(cpu, cfg->domain, cpu_online_mask)