summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommufd
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2023-03-01 15:30:18 -0400
committerJason Gunthorpe <jgg@nvidia.com>2023-03-06 10:51:56 -0400
commit085fcc7eb759c2b483f85b322e8c5146610010fd (patch)
treee694d8eb844034f85887a112a27be00770b3a678 /drivers/iommu/iommufd
parentfe15c26ee26efa11741a7b632e9f23b01aca4cc6 (diff)
downloadlinux-stable-085fcc7eb759c2b483f85b322e8c5146610010fd.tar.gz
linux-stable-085fcc7eb759c2b483f85b322e8c5146610010fd.tar.bz2
linux-stable-085fcc7eb759c2b483f85b322e8c5146610010fd.zip
iommufd: Assert devices_lock for iommufd_hw_pagetable_has_group()
The hwpt->devices list is locked by this, make it clearer. Link: https://lore.kernel.org/r/1-v3-ae9c2975a131+2e1e8-iommufd_hwpt_jgg@nvidia.com Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/iommu/iommufd')
-rw-r--r--drivers/iommu/iommufd/device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
index a0c66f47a65a..dcfaf6567420 100644
--- a/drivers/iommu/iommufd/device.c
+++ b/drivers/iommu/iommufd/device.c
@@ -186,6 +186,8 @@ static bool iommufd_hw_pagetable_has_group(struct iommufd_hw_pagetable *hwpt,
{
struct iommufd_device *cur_dev;
+ lockdep_assert_held(&hwpt->devices_lock);
+
list_for_each_entry(cur_dev, &hwpt->devices, devices_item)
if (cur_dev->group == group)
return true;