diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index da4da2b4baa9800586b783a6359f90175e7f3b09..187812e35c99bf62bfb632fc61fbd08ffc5abb63 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c @@ -1105,13 +1105,15 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd) err = iommu_device_register(&iommu->iommu); if (err) - goto err_unmap; + goto err_sysfs; } drhd->iommu = iommu; return 0; +err_sysfs: + iommu_device_sysfs_remove(&iommu->iommu); err_unmap: unmap_iommu(iommu); error_free_seq_id: