|
@@ -405,11 +405,6 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
|
|
|
if (events & EPOLLIN)
|
|
|
schedule_work(&irqfd->inject);
|
|
|
|
|
|
- /*
|
|
|
- * do not drop the file until the irqfd is fully initialized, otherwise
|
|
|
- * we might race against the EPOLLHUP
|
|
|
- */
|
|
|
- fdput(f);
|
|
|
#ifdef CONFIG_HAVE_KVM_IRQ_BYPASS
|
|
|
if (kvm_arch_has_irq_bypass()) {
|
|
|
irqfd->consumer.token = (void *)irqfd->eventfd;
|
|
@@ -425,6 +420,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 EPOLLHUP
|
|
|
+ */
|
|
|
+ fdput(f);
|
|
|
return 0;
|
|
|
|
|
|
fail:
|