KVM: PPC: Fix vcpu_create dereference before validity check.
Fix usage of vcpu struct before check that it's actually valid. Signed-off-by: Matt Evans <matt@ozlabs.org> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
4cf302bc10
commit
03cdab5340
|
@ -289,9 +289,10 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
|
||||||
{
|
{
|
||||||
struct kvm_vcpu *vcpu;
|
struct kvm_vcpu *vcpu;
|
||||||
vcpu = kvmppc_core_vcpu_create(kvm, id);
|
vcpu = kvmppc_core_vcpu_create(kvm, id);
|
||||||
vcpu->arch.wqp = &vcpu->wq;
|
if (!IS_ERR(vcpu)) {
|
||||||
if (!IS_ERR(vcpu))
|
vcpu->arch.wqp = &vcpu->wq;
|
||||||
kvmppc_create_vcpu_debugfs(vcpu, id);
|
kvmppc_create_vcpu_debugfs(vcpu, id);
|
||||||
|
}
|
||||||
return vcpu;
|
return vcpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue