Skip to content

Commit 01d5ccd

Browse files
Keith Buschgregkh
authored andcommitted
x86/apic: Handle zero vector gracefully in clear_vector_irq()
commit 1bdb897 upstream. 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: b5dc8e6 "x86/irq: Use hierarchical irqdomain to manage CPU interrupt vectors" Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b8f80ba commit 01d5ccd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/x86/kernel/apic/vector.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ static void clear_irq_vector(int irq, struct apic_chip_data *data)
254254
struct irq_desc *desc;
255255
int cpu, vector;
256256

257-
BUG_ON(!data->cfg.vector);
257+
if (!data->cfg.vector)
258+
return;
258259

259260
vector = data->cfg.vector;
260261
for_each_cpu_and(cpu, data->domain, cpu_online_mask)

0 commit comments

Comments
 (0)