[185/200] KVM: PPC: Do not create debugfs if fail to create vcpu

From: Greg KH
Date: Thu Jul 01 2010 - 17:30:12 EST


2.6.34-stable review patch. If anyone has any objections, please let me know.

------------------

From: Wei Yongjun <yjwei@xxxxxxxxxxxxxx>

If fail to create the vcpu, we should not create the debugfs
for it.

Signed-off-by: Wei Yongjun <yjwei@xxxxxxxxxxxxxx>
Acked-by: Alexander Graf <agraf@xxxxxxx>
Cc: stable@xxxxxxxxxx
Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

(Cherry-picked from commit 06056bfb944a0302a8f22eb45f09123de7fb417b)
---
arch/powerpc/kvm/powerpc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -193,7 +193,8 @@ struct kvm_vcpu *kvm_arch_vcpu_create(st
{
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;
}



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/