linux/drivers/vfio/mdev
Jason Gunthorpe 9a302449a5 vfio/mdev: Add missing reference counting to mdev_type
struct mdev_type holds a pointer to the kref'd object struct mdev_parent,
but doesn't hold the kref. The lifetime of the parent becomes implicit
because parent_remove_sysfs_files() is supposed to remove all the access
before the parent can be freed, but this is very hard to reason about.

Make it obviously correct by adding the missing get.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Message-Id: <7-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2021-04-07 15:39:17 -06:00
..
Kconfig
Makefile
mdev_core.c vfio/mdev: Expose mdev_get/put_parent to mdev_private.h 2021-04-07 15:39:17 -06:00
mdev_driver.c vfio/mdev: Simplify driver registration 2021-04-07 15:39:16 -06:00
mdev_private.h vfio/mdev: Expose mdev_get/put_parent to mdev_private.h 2021-04-07 15:39:17 -06:00
mdev_sysfs.c vfio/mdev: Add missing reference counting to mdev_type 2021-04-07 15:39:17 -06:00
vfio_mdev.c vfio/mdev: Simplify driver registration 2021-04-07 15:39:16 -06:00