From: Wei Yongjun Date: Tue, 9 Mar 2010 06:13:43 +0000 (+0800) Subject: KVM: PPC: Do not create debugfs if fail to create vcpu X-Git-Tag: firefly_0821_release~10186^2~1450 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=55d1dfd139e4f3e29e5b417683f48d396c271e73;p=firefly-linux-kernel-4.4.55.git KVM: PPC: Do not create debugfs if fail to create vcpu If fail to create the vcpu, we should not create the debugfs for it. Signed-off-by: Wei Yongjun Acked-by: Alexander Graf Cc: stable@kernel.org Signed-off-by: Avi Kivity Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 06056bfb944a0302a8f22eb45f09123de7fb417b) --- diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 2a4551f78f60..ff184f4771e9 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -176,7 +176,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; }