]> git.baikalelectronics.ru Git - kernel.git/commit
iommu: Make sysfs robust for non-API groups
authorRobin Murphy <robin.murphy@arm.com>
Wed, 4 May 2022 12:39:58 +0000 (13:39 +0100)
committerJoerg Roedel <jroedel@suse.de>
Wed, 4 May 2022 13:13:39 +0000 (15:13 +0200)
commit343326f57cd6556173adb3f7c4de51c414975a1c
tree39ebe565ec6b50fddc321f46bfae3a87e9feee9c
parent8ff0f4c619c5286596af11939c1921c716ccad3c
iommu: Make sysfs robust for non-API groups

Groups created by VFIO backends outside the core IOMMU API should never
be passed directly into the API itself, however they still expose their
standard sysfs attributes, so we can still stumble across them that way.
Take care to consider those cases before jumping into our normal
assumptions of a fully-initialised core API group.

Fixes: c8211bb505cb ("iommu: Use right way to retrieve iommu_ops")
Reported-by: Jan Stancek <jstancek@redhat.com>
Tested-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/86ada41986988511a8424e84746dfe9ba7f87573.1651667683.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c