summaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorSam Bobroff <sam.bobroff@au1.ibm.com>2014-09-19 01:40:41 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-09-22 13:21:29 +0200
commit27fbe64bfa63cfb9da025975b59d96568caa2d53 (patch)
treea7cc2aac710c41561e5eed5dd296eda2a777820b /virt/kvm/kvm_main.c
parentKVM: check for !is_zero_pfn() in kvm_is_mmio_pfn() (diff)
downloadlinux-27fbe64bfa63cfb9da025975b59d96568caa2d53.tar.xz
linux-27fbe64bfa63cfb9da025975b59d96568caa2d53.zip
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>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-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 96ec6226e4ab..95519bc959ed 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -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;