Skip to content

Commit 27fbe64

Browse files
sambltcbonzini
authored andcommitted
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>
1 parent 85c8555 commit 27fbe64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

virt/kvm/kvm_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ int kvm_vcpu_yield_to(struct kvm_vcpu *target)
17251725
rcu_read_lock();
17261726
pid = rcu_dereference(target->pid);
17271727
if (pid)
1728-
task = get_pid_task(target->pid, PIDTYPE_PID);
1728+
task = get_pid_task(pid, PIDTYPE_PID);
17291729
rcu_read_unlock();
17301730
if (!task)
17311731
return ret;

0 commit comments

Comments
 (0)