KVM: PPC: Do not create debugfs if fail to create vcpu
Subsystems (3)
PATCH 1/1 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 <[email protected]>
--- arch/powerpc/kvm/powerpc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/powerpc/kvm/powerpc.c +2 -1
@@ -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; }
Signature · 1 line
1.6.3.3
Quoted 4 lines · Wei Yongjun
If fail to create the vcpu, we should not create the debugfs for it.
Signed-off-by Wei Yongjun <[email protected]>
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 <[email protected]>
Alex
Avi Kivity
AppliedQuoted 3 lines · Wei Yongjun
If fail to create the vcpu, we should not create the debugfs for it.
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function