Otherwise we re-initialize the mmu caches, which will fail since the
caches are already registered, which will cause us to deinitialize said caches.
Signed-off-by: Avi Kivity <avi@qumranet.com>
int r;
struct kvm_x86_ops *ops = (struct kvm_x86_ops *)opaque;
- r = kvm_mmu_module_init();
- if (r)
- goto out_fail;
-
- kvm_init_msr_list();
-
if (kvm_x86_ops) {
printk(KERN_ERR "kvm: already loaded the other module\n");
r = -EEXIST;
goto out;
}
+ r = kvm_mmu_module_init();
+ if (r)
+ goto out;
+
+ kvm_init_msr_list();
+
kvm_x86_ops = ops;
kvm_mmu_set_nonpresent_ptes(0ull, 0ull);
return 0;
out:
- kvm_mmu_module_exit();
-out_fail:
return r;
}