* [PATCH] KVM: PPC: Do not create debugfs if fail to create vcpu
@ 2010-03-09 6:13 Wei Yongjun
2010-03-09 10:57 ` Alexander Graf
2010-03-09 12:43 ` Avi Kivity
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2010-03-09 6:13 UTC (permalink / raw)
To: Alexander Graf, kvm
If fail to create the vcpu, we should not create the debugfs
for it.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: PPC: Do not create debugfs if fail to create vcpu
2010-03-09 6:13 [PATCH] KVM: PPC: Do not create debugfs if fail to create vcpu Wei Yongjun
@ 2010-03-09 10:57 ` Alexander Graf
2010-03-09 12:43 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2010-03-09 10:57 UTC (permalink / raw)
To: Wei Yongjun; +Cc: KVM General, kvm-ppc
On 09.03.2010, at 07:13, Wei Yongjun wrote:
> If fail to create the vcpu, we should not create the debugfs
> for it.
>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Good catch.
I guess a goto out kind of construct would be better, but for a single line of code this is enough. And whoever adds more lines can put the goto into place.
Acked-by: Alexander Graf <agraf@suse.de>
Alex
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: PPC: Do not create debugfs if fail to create vcpu
2010-03-09 6:13 [PATCH] KVM: PPC: Do not create debugfs if fail to create vcpu Wei Yongjun
2010-03-09 10:57 ` Alexander Graf
@ 2010-03-09 12:43 ` Avi Kivity
1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2010-03-09 12:43 UTC (permalink / raw)
To: Wei Yongjun; +Cc: Alexander Graf, kvm
On 03/09/2010 08:13 AM, Wei Yongjun wrote:
> If fail to create the vcpu, we should not create the debugfs
> for it.
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-09 12:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-09 6:13 [PATCH] KVM: PPC: Do not create debugfs if fail to create vcpu Wei Yongjun
2010-03-09 10:57 ` Alexander Graf
2010-03-09 12:43 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox