From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Yongjun Subject: [PATCH] KVM: PPC: Do not create debugfs if fail to create vcpu Date: Tue, 09 Mar 2010 14:13:43 +0800 Message-ID: <4B95E717.6070806@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit To: Alexander Graf , kvm@vger.kernel.org Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:62127 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751243Ab0CIGMR (ORCPT ); Tue, 9 Mar 2010 01:12:17 -0500 Sender: kvm-owner@vger.kernel.org List-ID: If fail to create the vcpu, we should not create the debugfs for it. Signed-off-by: Wei Yongjun --- arch/powerpc/kvm/powerpc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) 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; } -- 1.6.3.3