KVM: Fix racy in kvm_free_assigned_irq
[linux-2.6.git] / arch / x86 / kvm / x86.c
index b0fc079..fc3e329 100644 (file)
@@ -4129,11 +4129,11 @@ static void kvm_free_vcpus(struct kvm *kvm)
 
 void kvm_arch_sync_events(struct kvm *kvm)
 {
+       kvm_free_all_assigned_devices(kvm);
 }
 
 void kvm_arch_destroy_vm(struct kvm *kvm)
 {
-       kvm_free_all_assigned_devices(kvm);
        kvm_iommu_unmap_guest(kvm);
        kvm_free_pit(kvm);
        kfree(kvm->arch.vpic);