Skip to content

Commit

Permalink
KVM: Unset kvm_arch_ops if arch module loading failed
Browse files Browse the repository at this point in the history
Otherwise, the core module thinks the arch module is loaded, and won't
let you reload it after you've fixed the bug.

Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Avi Kivity committed Mar 18, 2007
1 parent b720a3b commit ca45aaa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2464,7 +2464,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)

r = kvm_arch_ops->hardware_setup();
if (r < 0)
return r;
goto out;

on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1);
r = register_cpu_notifier(&kvm_cpu_notifier);
Expand Down Expand Up @@ -2500,6 +2500,8 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module)
out_free_1:
on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1);
kvm_arch_ops->hardware_unsetup();
out:
kvm_arch_ops = NULL;
return r;
}

Expand Down

0 comments on commit ca45aaa

Please sign in to comment.