From 14e122fcc45d8a86e27be9663cbd7bcea1602b25 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 14 May 2019 16:22:17 +0200 Subject: [PATCH] IOMMU: avoid NULL deref in iommu_lookup_page() Luckily the function currently has no callers - it would have called through NULL for both Arm and x86/AMD. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Reviewed-by: Paul Durrant --- xen/drivers/passthrough/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index b453b32191..0d2dacf287 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -409,7 +409,7 @@ int iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t *mfn, { const struct domain_iommu *hd = dom_iommu(d); - if ( !iommu_enabled || !hd->platform_ops ) + if ( !iommu_enabled || !hd->platform_ops || !hd->platform_ops->lookup_page ) return -EOPNOTSUPP; return hd->platform_ops->lookup_page(d, dfn, mfn, flags); -- 2.39.5