linux/samples/vfio-mdev
Jason Gunthorpe 3cb2482714 vfio/mbochs: Fix close when multiple device FDs are open
mbochs_close() iterates over global device state and frees it. Currently
this is done every time a device FD is closed, but if multiple device FDs
are open this could corrupt other still active FDs.

Change this to use close_device() so it only runs on the last close.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/11-v4-9ea22c5e6afb+1adf-vfio_reflck_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2021-08-11 09:50:11 -06:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mbochs.c vfio/mbochs: Fix close when multiple device FDs are open 2021-08-11 09:50:11 -06:00
mdpy-defs.h PCI: Move PCI_VENDOR_ID_REDHAT definition to pci_ids.h 2020-07-09 17:00:47 -05:00
mdpy-fb.c samples: vfio-mdev: fix error handing in mdpy_fb_probe() 2021-05-24 13:40:13 -06:00
mdpy.c vfio/samples: Delete useless open/close 2021-08-11 09:50:11 -06:00
mtty.c vfio/samples: Delete useless open/close 2021-08-11 09:50:11 -06:00