]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/io-pgtable: Abstract iommu_iotlb_gather access
authorRobin Murphy <robin.murphy@arm.com>
Fri, 20 Aug 2021 13:14:42 +0000 (14:14 +0100)
committerJoerg Roedel <jroedel@suse.de>
Fri, 20 Aug 2021 15:14:27 +0000 (17:14 +0200)
commit57708bfc077bd777a838dd50d2c2978acd66eb0b
tree6f59fecfc16b28b28444aff1bd101df7569e045a
parente9ab7993e36a3c9fbd3d689f1b5b9da7efe6b02d
iommu/io-pgtable: Abstract iommu_iotlb_gather access

Previously io-pgtable merely passed the iommu_iotlb_gather pointer
through to helpers, but now it has grown its own direct dereference.
This turns out to break the build for !IOMMU_API configs where the
structure only has a dummy definition. It will probably also crash
drivers who don't use the gather mechanism and simply pass in NULL.

Wrap this dereference in a suitable helper which can both be stubbed
out for !IOMMU_API and encapsulate a NULL check otherwise.

Fixes: 332080350a1d ("iommu: Indicate queued flushes via gather data")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/83672ee76f6405c82845a55c148fa836f56fbbc1.1629465282.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/io-pgtable-arm-v7s.c
drivers/iommu/io-pgtable-arm.c
include/linux/iommu.h