KVM: Fix kvm mmu_notifier initialization order
[linux-2.6.git] / virt / kvm / kvm_main.c
index ed3c4e7..22cdb96 100644 (file)
@@ -467,6 +467,7 @@ static struct kvm *kvm_create_vm(void)
                if (!kvm->buses[i])
                        goto out_err;
        }
+       spin_lock_init(&kvm->mmu_lock);
 
        r = kvm_init_mmu_notifier(kvm);
        if (r)
@@ -474,7 +475,6 @@ static struct kvm *kvm_create_vm(void)
 
        kvm->mm = current->mm;
        atomic_inc(&kvm->mm->mm_count);
-       spin_lock_init(&kvm->mmu_lock);
        kvm_eventfd_init(kvm);
        mutex_init(&kvm->lock);
        mutex_init(&kvm->irq_lock);