diff options
author | Anthony DeRossi <[email protected]> | 2022-11-09 17:40:25 -0800 |
---|---|---|
committer | Alex Williamson <[email protected]> | 2022-11-10 12:03:36 -0700 |
commit | 7fdba0011157861892c470995ff586a1871e603f (patch) | |
tree | 9c96d214732e9c258dd8dedb6d643c5874ed42b1 /tools/perf/scripts/python/compaction-times.py | |
parent | f0c4d9fc9cc9462659728d168387191387e903cc (diff) |
vfio: Fix container device registration life cycle
In vfio_device_open(), vfio_device_container_register() is always called
when open_count == 1. On error, vfio_device_container_unregister() is
only called when open_count == 1 and close_device is set. This leaks a
registration for devices without a close_device implementation.
In vfio_device_fops_release(), vfio_device_container_unregister() is
called unconditionally. This can cause a device to be unregistered
multiple times.
Treating container device registration/unregistration uniformly (always
when open_count == 1) fixes both issues.
Fixes: ce4b4657ff18 ("vfio: Replace the DMA unmapping notifier with a callback")
Signed-off-by: Anthony DeRossi <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Reviewed-by: Yi Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/compaction-times.py')
0 files changed, 0 insertions, 0 deletions