mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
VT-d: correct off-by-1 in number-of-IOMMUs check
Otherwise, if we really run on a system with this many IOMMUs, entering/leaving S3 would overrun iommu_state[]. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Release-Acked-by: Ian Jackson <iwj@xenproject.org>
This commit is contained in:
1 parent
ecdff2f5a0
commit
b9b3082002
1 file changed
+2
-2
@@ -1168,10 +1168,10 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd)
|
||||
unsigned long sagaw, nr_dom;
|
||||
int agaw;
|
||||
|
||||
if ( nr_iommus > MAX_IOMMUS )
|
||||
if ( nr_iommus >= MAX_IOMMUS )
|
||||
{
|
||||
dprintk(XENLOG_ERR VTDPREFIX,
|
||||
"IOMMU: nr_iommus %d > MAX_IOMMUS\n", nr_iommus);
|
||||
"IOMMU: nr_iommus %d > MAX_IOMMUS\n", nr_iommus + 1);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||