linux/drivers/iommu/intel
Guoqing Jiang 9d9995b037 iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping()
commit 99e675d473 upstream.

After commit e3beca48a4 ("irqdomain/treewide: Keep firmware node
unconditionally allocated"). For tear down scenario, fn is only freed
after fail to allocate ir_domain, though it also should be freed in case
dmar_enable_qi returns error.

Besides free fn, irq_domain and ir_msi_domain need to be removed as well
if intel_setup_irq_remapping fails to enable queued invalidation.

Improve the rewinding path by add out_free_ir_domain and out_free_fwnode
lables per Baolu's suggestion.

Fixes: e3beca48a4 ("irqdomain/treewide: Keep firmware node unconditionally allocated")
Suggested-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Link: https://lore.kernel.org/r/20220119063640.16864-1-guoqing.jiang@linux.dev
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20220128031002.2219155-3-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-08 18:30:37 +01:00
..
debugfs.c iommu/vt-d: Rename intel-pasid.h to pasid.h 2020-07-24 10:51:21 +02:00
dmar.c iommu/vt-d: Fix sysfs leak in alloc_iommu() 2021-06-03 09:00:27 +02:00
iommu.c iommu/vt-d: Use user privilege for RID2PASID translation 2021-06-03 09:00:49 +02:00
irq_remapping.c iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping() 2022-02-08 18:30:37 +01:00
Kconfig IOMMU Updates for Linux v5.9 2020-08-11 14:13:24 -07:00
Makefile iommu/vt-d: Move Kconfig and Makefile bits down into intel directory 2020-07-29 14:14:55 +02:00
pasid.c iommu/vt-d: Fix incomplete cache flush in intel_pasid_tear_down_entry() 2021-08-26 08:35:51 -04:00
pasid.h iommu/vt-d: Update the virtual command related registers 2021-09-18 13:40:14 +02:00
svm.c iommu/vt-d: Consolidate duplicate cache invaliation code 2021-08-26 08:35:50 -04:00
trace.c