diff mbox series

[v3,01/12] iommufd: Assert devices_lock for iommufd_hw_pagetable_has_group()

Message ID 1-v3-ae9c2975a131+2e1e8-iommufd_hwpt_jgg@nvidia.com (mailing list archive)
State Accepted
Commit 085fcc7eb759c2b483f85b322e8c5146610010fd
Headers show
Series Revise the hwpt lifetime model | expand

Commit Message

Jason Gunthorpe March 1, 2023, 7:30 p.m. UTC
The hwpt->devices list is locked by this, make it clearer.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/iommufd/device.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
index a0c66f47a65ada..dcfaf6567420e0 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;