All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] [PULL REQUEST] iommu/vt-d: Fixes for v5.13-rc4
@ 2021-05-25  7:08 Lu Baolu
  2021-05-25  7:08   ` Lu Baolu
  0 siblings, 1 reply; 3+ messages in thread
From: Lu Baolu @ 2021-05-25  7:08 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, Rolf Eike Beer

Hi Joerg,

A small fix is queued for v5.13. It fixes:

 - sysfs leak in alloc_iommu.

Please consider it for v5.13.

Best regards,
Lu Baolu

Rolf Eike Beer (1):
  iommu/vt-d: Fix sysfs leak in alloc_iommu()

 drivers/iommu/intel/dmar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.25.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] iommu/vt-d: Fix sysfs leak in alloc_iommu()
  2021-05-25  7:08 [PATCH 0/1] [PULL REQUEST] iommu/vt-d: Fixes for v5.13-rc4 Lu Baolu
@ 2021-05-25  7:08   ` Lu Baolu
  0 siblings, 0 replies; 3+ messages in thread
From: Lu Baolu @ 2021-05-25  7:08 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: Rolf Eike Beer, iommu, stable, Lu Baolu

From: Rolf Eike Beer <eb@emlix.com>

iommu_device_sysfs_add() is called before, so is has to be cleaned on subsequent
errors.

Fixes: 39ab9555c2411 ("iommu: Add sysfs bindings for struct iommu_device")
Cc: stable@vger.kernel.org # 4.11.x
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/17411490.HIIP88n32C@mobilepool36.emlix.com
---
 drivers/iommu/intel/dmar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 1757ac1e1623..84057cb9596c 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1142,7 +1142,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
 
 		err = iommu_device_register(&iommu->iommu, &intel_iommu_ops, NULL);
 		if (err)
-			goto err_unmap;
+			goto err_sysfs;
 	}
 
 	drhd->iommu = iommu;
@@ -1150,6 +1150,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
 
 	return 0;
 
+err_sysfs:
+	iommu_device_sysfs_remove(&iommu->iommu);
 err_unmap:
 	unmap_iommu(iommu);
 error_free_seq_id:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 1/1] iommu/vt-d: Fix sysfs leak in alloc_iommu()
@ 2021-05-25  7:08   ` Lu Baolu
  0 siblings, 0 replies; 3+ messages in thread
From: Lu Baolu @ 2021-05-25  7:08 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: iommu, Rolf Eike Beer, stable

From: Rolf Eike Beer <eb@emlix.com>

iommu_device_sysfs_add() is called before, so is has to be cleaned on subsequent
errors.

Fixes: 39ab9555c2411 ("iommu: Add sysfs bindings for struct iommu_device")
Cc: stable@vger.kernel.org # 4.11.x
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/17411490.HIIP88n32C@mobilepool36.emlix.com
---
 drivers/iommu/intel/dmar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 1757ac1e1623..84057cb9596c 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1142,7 +1142,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
 
 		err = iommu_device_register(&iommu->iommu, &intel_iommu_ops, NULL);
 		if (err)
-			goto err_unmap;
+			goto err_sysfs;
 	}
 
 	drhd->iommu = iommu;
@@ -1150,6 +1150,8 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
 
 	return 0;
 
+err_sysfs:
+	iommu_device_sysfs_remove(&iommu->iommu);
 err_unmap:
 	unmap_iommu(iommu);
 error_free_seq_id:
-- 
2.25.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-25  7:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25  7:08 [PATCH 0/1] [PULL REQUEST] iommu/vt-d: Fixes for v5.13-rc4 Lu Baolu
2021-05-25  7:08 ` [PATCH 1/1] iommu/vt-d: Fix sysfs leak in alloc_iommu() Lu Baolu
2021-05-25  7:08   ` Lu Baolu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.