From: Wei Yongjun <[email protected]>

If fail to create the vcpu, we should not create the debugfs
for it.

Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Alexander Graf <[email protected]>
Cc: [email protected]
Signed-off-by: Avi Kivity <[email protected]>

diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 5a8eb95..a0e3172 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -193,7 +193,8 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, 
unsigned int id)
 {
        struct kvm_vcpu *vcpu;
        vcpu = kvmppc_core_vcpu_create(kvm, id);
-       kvmppc_create_vcpu_debugfs(vcpu, id);
+       if (!IS_ERR(vcpu))
+               kvmppc_create_vcpu_debugfs(vcpu, id);
        return vcpu;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to