All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] KVM: correct null pid check in kvm_vcpu_yield_to()
@ 2014-09-18 23:40 Sam Bobroff
  2014-09-19 13:33 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Sam Bobroff @ 2014-09-18 23:40 UTC (permalink / raw)
  To: gleb, pbonzini; +Cc: kvm

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

 virt/kvm/kvm_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 33712fb..688acb0 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;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-19 13:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 23:40 [PATCH 1/1] KVM: correct null pid check in kvm_vcpu_yield_to() Sam Bobroff
2014-09-19 13:33 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.