diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 0984fa58d87274302a8b9c57e8ee7f54c9c47b20..5d7383775bf1cc689ae39f98a488575ae92a5ae0 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -1480,7 +1480,8 @@ static void free_dmar_iommu(struct intel_iommu *iommu) domain = iommu->domains[i]; clear_bit(i, iommu->domain_ids); - if (domain_detach_iommu(domain, iommu) == 0) + if (domain_detach_iommu(domain, iommu) == 0 && + !domain_type_is_vm(domain)) domain_exit(domain); } }