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: Sam Bobroff <sam.bobroff@au1.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
85c8555ff0
commit
27fbe64bfa
|
@ -1725,7 +1725,7 @@ int kvm_vcpu_yield_to(struct kvm_vcpu *target)
|
|||
rcu_read_lock();
|
||||
pid = rcu_dereference(target->pid);
|
||||
if (pid)
|
||||
task = get_pid_task(target->pid, PIDTYPE_PID);
|
||||
task = get_pid_task(pid, PIDTYPE_PID);
|
||||
rcu_read_unlock();
|
||||
if (!task)
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue