summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/iommu/dmar.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 80e3c176008e..add177a37f00 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -1070,6 +1070,12 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
intel_iommu_groups,
"%s", iommu->name);
+ if (IS_ERR(iommu->iommu_dev)) {
+ drhd->iommu = NULL;
+ err = PTR_ERR(iommu->iommu_dev);
+ goto err_unmap;
+ }
+
return 0;
err_unmap: