>From c7c3cc3a048576fd1e196e67b11ae0193e7fba1e Mon Sep 17 00:00:00 2001 From: Jiang Liu Date: Tue, 15 Dec 2015 15:40:43 +0800 Subject: [PATCH] Signed-off-by: Jiang Liu --- arch/x86/kernel/apic/vector.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index f03957e7c50d..fce2853f70d9 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -116,14 +116,13 @@ static int __assign_irq_vector(int irq, struct apic_chip_data *d, */ static int current_vector = FIRST_EXTERNAL_VECTOR + VECTOR_OFFSET_START; static int current_offset = VECTOR_OFFSET_START % 16; - int cpu, err; - unsigned int dest = d->cfg.dest_apicid; + int cpu, err = -ENOSPC; + unsigned int dest; if (d->move_in_progress) return -EBUSY; /* Only try and allocate irqs on cpus that are present */ - err = -ENOSPC; cpumask_clear(d->old_domain); cpumask_clear(used_cpumask); cpu = cpumask_first_and(mask, cpu_online_mask); @@ -133,9 +132,6 @@ static int __assign_irq_vector(int irq, struct apic_chip_data *d, apic->vector_allocation_domain(cpu, vector_cpumask, mask); if (cpumask_subset(vector_cpumask, d->domain)) { - err = 0; - if (cpumask_equal(vector_cpumask, d->domain)) - break; /* * New cpumask using the vector is a proper subset of * the current in use mask. So cleanup the vector @@ -144,7 +140,7 @@ static int __assign_irq_vector(int irq, struct apic_chip_data *d, cpumask_and(used_cpumask, d->domain, vector_cpumask); err = apic->cpu_mask_to_apicid_and(mask, used_cpumask, &dest); - if (err) + if (err || cpumask_equal(vector_cpumask, d->domain)) break; cpumask_andnot(d->old_domain, d->domain, vector_cpumask); -- 1.7.10.4