KVM: add missing misc_deregister() on error in kvm_init()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sun, 5 May 2013 12:03:40 +0000 (20:03 +0800)
committerGleb Natapov <gleb@redhat.com>
Sun, 12 May 2013 09:06:24 +0000 (12:06 +0300)
Add the missing misc_deregister() before return from kvm_init()
in the debugfs init error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
virt/kvm/kvm_main.c

index 302681c4aa4465bb21b69524d7c0d3a5341f4a4e..b547a1ceecbca411140663db554b2afabcf04a34 100644 (file)
@@ -3181,6 +3181,7 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
 
 out_undebugfs:
        unregister_syscore_ops(&kvm_syscore_ops);
+       misc_deregister(&kvm_dev);
 out_unreg:
        kvm_async_pf_deinit();
 out_free: