]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping()
authorGuoqing Jiang <guoqing.jiang@linux.dev>
Fri, 28 Jan 2022 03:10:02 +0000 (11:10 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 29 Mar 2022 07:14:00 +0000 (09:14 +0200)
commit1fe4ae8bf892ab0aeef8ec22401d39a155d066ca
tree545d6e029b3fbba8b43334420d0d7d68fc83d5f6
parenta1f27e124ddd358efdd412c8aacb1d553117f07d
iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping()

BugLink: https://bugs.launchpad.net/bugs/1964634
commit 99e675d473eb8cf2deac1376a0f840222fc1adcf upstream.

After commit e3beca48a45b ("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: e3beca48a45b ("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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/iommu/intel_irq_remapping.c