Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03cdab53 authored by Matt Evans's avatar Matt Evans Committed by Avi Kivity
Browse files

KVM: PPC: Fix vcpu_create dereference before validity check.



Fix usage of vcpu struct before check that it's actually valid.

Signed-off-by: default avatarMatt Evans <matt@ozlabs.org>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 4cf302bc
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -289,9 +289,10 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
{
	struct kvm_vcpu *vcpu;
	vcpu = kvmppc_core_vcpu_create(kvm, id);
	if (!IS_ERR(vcpu)) {
		vcpu->arch.wqp = &vcpu->wq;
	if (!IS_ERR(vcpu))
		kvmppc_create_vcpu_debugfs(vcpu, id);
	}
	return vcpu;
}