summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-08-29 15:39:57 +0100
committerMark Brown <broonie@kernel.org>2018-08-29 15:39:57 +0100
commit3a9cbd70c74f3a4afc78f898f7f95519ef5c5477 (patch)
tree47db1e11546b79db7e66ba40812de67223091de8 /virt
parent7057964870d64963153ec86558ecaa6ac742a929 (diff)
parent577189c37a844243359afce1c3c94418259fe696 (diff)
Merge tag 'v4.4.153' into linux-linaro-lsk-v4.4
This is the 4.4.153 stable release
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/eventfd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index 1203829316b2..f509cfd37db5 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -405,11 +405,6 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
if (events & POLLIN)
schedule_work(&irqfd->inject);
- /*
- * do not drop the file until the irqfd is fully initialized, otherwise
- * we might race against the POLLHUP
- */
- fdput(f);
#ifdef CONFIG_HAVE_KVM_IRQ_BYPASS
irqfd->consumer.token = (void *)irqfd->eventfd;
irqfd->consumer.add_producer = kvm_arch_irq_bypass_add_producer;
@@ -423,6 +418,12 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
#endif
srcu_read_unlock(&kvm->irq_srcu, idx);
+
+ /*
+ * do not drop the file until the irqfd is fully initialized, otherwise
+ * we might race against the POLLHUP
+ */
+ fdput(f);
return 0;
fail: