Commit 27fbe64b authored by Sam Bobroff's avatar Sam Bobroff Committed by Paolo Bonzini

KVM: correct null pid check in kvm_vcpu_yield_to()

Correct a simple mistake of checking the wrong variable
before a dereference, resulting in the dereference not being
properly protected by rcu_dereference().
Signed-off-by: default avatarSam Bobroff <sam.bobroff@au1.ibm.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 85c8555f
...@@ -1725,7 +1725,7 @@ int kvm_vcpu_yield_to(struct kvm_vcpu *target) ...@@ -1725,7 +1725,7 @@ int kvm_vcpu_yield_to(struct kvm_vcpu *target)
rcu_read_lock(); rcu_read_lock();
pid = rcu_dereference(target->pid); pid = rcu_dereference(target->pid);
if (pid) if (pid)
task = get_pid_task(target->pid, PIDTYPE_PID); task = get_pid_task(pid, PIDTYPE_PID);
rcu_read_unlock(); rcu_read_unlock();
if (!task) if (!task)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment