From: Jason Gunthorpe Date: Thu, 29 Sep 2022 17:48:35 +0000 (-0300) Subject: drm/i915/gvt: Add missing vfio_unregister_group_dev() call X-Git-Tag: v6.0.9~190 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ee9f05d7893942e8d5886d534f7f623573d4db8;p=thirdparty%2Fkernel%2Fstable.git drm/i915/gvt: Add missing vfio_unregister_group_dev() call commit f423fa1bc9fe1978e6b9f54927411b62cb43eb04 upstream. When converting to directly create the vfio_device the mdev driver has to put a vfio_register_emulated_iommu_dev() in the probe() and a pairing vfio_unregister_group_dev() in the remove. This was missed for gvt, add it. Cc: stable@vger.kernel.org Fixes: 978cf586ac35 ("drm/i915/gvt: convert to use vfio_register_emulated_iommu_dev") Reported-by: Alex Williamson Signed-off-by: Jason Gunthorpe Reviewed-by: Kevin Tian Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/0-v1-013609965fe8+9d-vfio_gvt_unregister_jgg@nvidia.com Signed-off-by: Alex Williamson Reviewed-by: Kevin Tian # v6.0 backport Signed-off-by: Alex Williamson # v6.0 backport Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index e3cd589464777..de89946c4817f 100644 --- a/drivers/gpu/drm/i915/gvt/kvmgt.c +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c @@ -1595,6 +1595,9 @@ static void intel_vgpu_remove(struct mdev_device *mdev) if (WARN_ON_ONCE(vgpu->attached)) return; + + vfio_unregister_group_dev(&vgpu->vfio_device); + vfio_uninit_group_dev(&vgpu->vfio_device); intel_gvt_destroy_vgpu(vgpu); }