diff options
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/irq_comm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c index 0d454d352717..9b077342ab54 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c | |||
@@ -243,6 +243,10 @@ void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id) | |||
243 | printk(KERN_ERR "kvm: IRQ source ID out of range!\n"); | 243 | printk(KERN_ERR "kvm: IRQ source ID out of range!\n"); |
244 | goto unlock; | 244 | goto unlock; |
245 | } | 245 | } |
246 | clear_bit(irq_source_id, &kvm->arch.irq_sources_bitmap); | ||
247 | if (!irqchip_in_kernel(kvm)) | ||
248 | goto unlock; | ||
249 | |||
246 | for (i = 0; i < KVM_IOAPIC_NUM_PINS; i++) { | 250 | for (i = 0; i < KVM_IOAPIC_NUM_PINS; i++) { |
247 | clear_bit(irq_source_id, &kvm->arch.vioapic->irq_states[i]); | 251 | clear_bit(irq_source_id, &kvm->arch.vioapic->irq_states[i]); |
248 | if (i >= 16) | 252 | if (i >= 16) |
@@ -251,7 +255,6 @@ void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id) | |||
251 | clear_bit(irq_source_id, &pic_irqchip(kvm)->irq_states[i]); | 255 | clear_bit(irq_source_id, &pic_irqchip(kvm)->irq_states[i]); |
252 | #endif | 256 | #endif |
253 | } | 257 | } |
254 | clear_bit(irq_source_id, &kvm->arch.irq_sources_bitmap); | ||
255 | unlock: | 258 | unlock: |
256 | mutex_unlock(&kvm->irq_lock); | 259 | mutex_unlock(&kvm->irq_lock); |
257 | } | 260 | } |