Skip to content

Commit 64945d1

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu: Mark dev_iommu_get() with lockdep
Allocation of dev->iommu must be done under the iommu_probe_device_lock. Mark this with lockdep to discourage future mistakes. Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com> Tested-by: Hector Martin <marcan@marcan.st> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Moritz Fischer <moritzf@google.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/4-v2-16e4def25ebb+820-iommu_fwspec_p1_jgg@nvidia.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 5b4ea8b commit 64945d1

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/iommu/iommu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ static struct dev_iommu *dev_iommu_get(struct device *dev)
334334
{
335335
struct dev_iommu *param = dev->iommu;
336336

337+
lockdep_assert_held(&iommu_probe_device_lock);
338+
337339
if (param)
338340
return param;
339341

0 commit comments

Comments
 (0)