From: Jan Beulich Date: Tue, 14 May 2019 14:22:17 +0000 (+0200) Subject: IOMMU: avoid NULL deref in iommu_lookup_page() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~2254 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=14e122fcc45d8a86e27be9663cbd7bcea1602b25;p=xen.git 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 --- 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);