]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
KVM: PPC: Do not create debugfs if fail to create vcpu
authorWei Yongjun <yjwei@cn.fujitsu.com>
Tue, 9 Mar 2010 06:13:43 +0000 (14:13 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:23:00 +0000 (11:23 -0700)
If fail to create the vcpu, we should not create the debugfs
for it.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Acked-by: Alexander Graf <agraf@suse.de>
Cc: stable@kernel.org
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
(Cherry-picked from commit 06056bfb944a0302a8f22eb45f09123de7fb417b)

arch/powerpc/kvm/powerpc.c

index 297fcd2ff7d01a0d9dddf473b1cc4e4415fccf4b..bf36a9d6138a38352edf1bd44ce6dac19f9225ea 100644 (file)
@@ -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;
 }