aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/eventfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'virt/kvm/eventfd.c')
-rw-r--r--virt/kvm/eventfd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index abe4d6043b36..29c2a04e036e 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -391,19 +391,19 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
391 lockdep_is_held(&kvm->irqfds.lock)); 391 lockdep_is_held(&kvm->irqfds.lock));
392 irqfd_update(kvm, irqfd, irq_rt); 392 irqfd_update(kvm, irqfd, irq_rt);
393 393
394 events = f.file->f_op->poll(f.file, &irqfd->pt);
395
396 list_add_tail(&irqfd->list, &kvm->irqfds.items); 394 list_add_tail(&irqfd->list, &kvm->irqfds.items);
397 395
396 spin_unlock_irq(&kvm->irqfds.lock);
397
398 /* 398 /*
399 * Check if there was an event already pending on the eventfd 399 * Check if there was an event already pending on the eventfd
400 * before we registered, and trigger it as if we didn't miss it. 400 * before we registered, and trigger it as if we didn't miss it.
401 */ 401 */
402 events = f.file->f_op->poll(f.file, &irqfd->pt);
403
402 if (events & POLLIN) 404 if (events & POLLIN)
403 schedule_work(&irqfd->inject); 405 schedule_work(&irqfd->inject);
404 406
405 spin_unlock_irq(&kvm->irqfds.lock);
406
407 /* 407 /*
408 * do not drop the file until the irqfd is fully initialized, otherwise 408 * do not drop the file until the irqfd is fully initialized, otherwise
409 * we might race against the POLLHUP 409 * we might race against the POLLHUP