diff options
Diffstat (limited to 'xen/drivers/passthrough/vtd/iommu.c')
-rw-r--r-- | xen/drivers/passthrough/vtd/iommu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index ddf713b423..fd3abcbcef 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1160,6 +1160,9 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd) dprintk(VTDPREFIX, "cap = %"PRIx64" ecap = %"PRIx64"\n", iommu->cap, iommu->ecap); } + if ( !(iommu->cap + 1) || !(iommu->ecap + 1) ) + return -ENODEV; + if ( cap_fault_reg_offset(iommu->cap) + cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN >= PAGE_SIZE || ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE ) |