summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommufd/device.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2023-07-17 20:12:04 +0200
committerJason Gunthorpe <jgg@nvidia.com>2023-07-26 15:19:47 +0200
commitd03f1336fd91b87ad218dd398265332b1cd2c68c (patch)
tree64cb5954570ad41c039939c7d5c9c66fc73ca415 /drivers/iommu/iommufd/device.c
parentiommufd: Make sw_msi_start a group global (diff)
downloadlinux-d03f1336fd91b87ad218dd398265332b1cd2c68c.tar.xz
linux-d03f1336fd91b87ad218dd398265332b1cd2c68c.zip
iommufd: Move putting a hwpt to a helper function
Next patch will need to call this from two places. Link: https://lore.kernel.org/r/8-v8-6659224517ea+532-iommufd_alloc_jgg@nvidia.com Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Tested-by: Nicolin Chen <nicolinc@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/iommu/iommufd/device.c')
-rw-r--r--drivers/iommu/iommufd/device.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
index 4b41ef5292a5..89cef2d2a2b1 100644
--- a/drivers/iommu/iommufd/device.c
+++ b/drivers/iommu/iommufd/device.c
@@ -526,11 +526,7 @@ void iommufd_device_detach(struct iommufd_device *idev)
struct iommufd_hw_pagetable *hwpt;
hwpt = iommufd_hw_pagetable_detach(idev);
- if (hwpt->auto_domain)
- iommufd_object_destroy_user(idev->ictx, &hwpt->obj);
- else
- refcount_dec(&hwpt->obj.users);
-
+ iommufd_hw_pagetable_put(idev->ictx, hwpt);
refcount_dec(&idev->obj.users);
}
EXPORT_SYMBOL_NS_GPL(iommufd_device_detach, IOMMUFD);