aboutsummaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorSam Bobroff <sam.bobroff@au1.ibm.com>2014-09-19 09:40:41 +1000
committerChristoffer Dall <christoffer.dall@linaro.org>2014-10-08 11:11:28 +0200
commitb8a669d29702a8fb529f4fae450a86b8676b0e42 (patch)
tree588f1b850a7e13d0e2f3461d66909db55c7531fb /virt
parent331a9a729183832840d656036c5bc2b81942c294 (diff)
downloadlinux-linaro-stable-b8a669d29702a8fb529f4fae450a86b8676b0e42.tar.gz
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> (cherry picked from commit 27fbe64bfa63cfb9da025975b59d96568caa2d53) Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index b64d44219f27..9cae94206f41 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1728,7 +1728,7 @@ bool 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;