Or also add this:If the iovad->rcaches allocation failed, will skip iommu domain dma ops, so no need *any* iovad,->rcaches check, right ?
diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 0d6d8edf782d..e8f0b8f47f45 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -578,6 +578,12 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
goto done_unlock;
}
+ if (!iovad->rcaches) {
+ pr_warn("IOVA domain rcache not properly initialised\n");
+ ret = -EFAULT;
+ goto done_unlock;
+ }
+
ret = 0;
goto done_unlock;
and there is already warning about the fallback.