Skip to content

Commit fcdc0d3

Browse files
committed
vfio/platform: Disable virqfds on cleanup
irqfds for mask and unmask that are not specifically disabled by the user are leaked. Remove any irqfds during cleanup Cc: Eric Auger <eric.auger@redhat.com> Cc: <stable@vger.kernel.org> Fixes: a7fa7c7 ("vfio/platform: implement IRQ masking/unmasking via an eventfd") Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Link: https://lore.kernel.org/r/20240308230557.805580-6-alex.williamson@redhat.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
1 parent 18c198c commit fcdc0d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/vfio/platform/vfio_platform_irq.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,11 @@ void vfio_platform_irq_cleanup(struct vfio_platform_device *vdev)
321321
{
322322
int i;
323323

324-
for (i = 0; i < vdev->num_irqs; i++)
324+
for (i = 0; i < vdev->num_irqs; i++) {
325+
vfio_virqfd_disable(&vdev->irqs[i].mask);
326+
vfio_virqfd_disable(&vdev->irqs[i].unmask);
325327
vfio_set_trigger(vdev, i, -1, NULL);
328+
}
326329

327330
vdev->num_irqs = 0;
328331
kfree(vdev->irqs);

0 commit comments

Comments
 (0)