Browse Source

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>
Sam Bobroff 11 years ago
parent
commit
27fbe64bfa
1 changed files with 1 additions and 1 deletions
  1. 1 1
      virt/kvm/kvm_main.c

+ 1 - 1
virt/kvm/kvm_main.c

@@ -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;