[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1716403.SmlLz2RZUD@devpool47>
Date: Wed, 21 Apr 2021 17:12:41 +0200
From: Rolf Eike Beer <eb@...ix.com>
To: Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>
Cc: David Woodhouse <dwmw2@...radead.org>,
Lu Baolu <baolu.lu@...ux.intel.com>,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: [PATCH] Intel IOMMU: fix sysfs leak in hotplug init path
Signed-off-by: Rolf Eike Beer <eb@...ix.com>
---
drivers/iommu/intel/dmar.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
I have not actually tested this but I guess it should match the code in
free_iommu() just below.
diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index d5c51b5c20af..fb37a9b79b3a 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1144,7 +1144,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
err = iommu_device_register(&iommu->iommu);
if (err)
- goto err_unmap;
+ goto err_unregister;
}
drhd->iommu = iommu;
@@ -1152,6 +1152,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
return 0;
+err_unregister:
+ iommu_device_sysfs_remove(&iommu->iommu);
err_unmap:
unmap_iommu(iommu);
error_free_seq_id:
--
2.31.1
--
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055
emlix - smart embedded open source
Powered by blists - more mailing lists