]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
iommu/vt-d: Clean up si_domain in the init_dmars() error path
authorJerry Snitselaar <jsnitsel@redhat.com>
Wed, 19 Oct 2022 00:44:47 +0000 (08:44 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 24 Nov 2022 13:25:52 +0000 (14:25 +0100)
commit2ace1d2e2140980abeb77c48822084a4b44db5fb
tree1389673618232346da28dcb3126fff5840bd23f5
parent62cf141acf73c38b9f50950e927d709906f7dbd5
iommu/vt-d: Clean up si_domain in the init_dmars() error path

BugLink: https://bugs.launchpad.net/bugs/1997113
[ Upstream commit 620bf9f981365c18cc2766c53d92bf8131c63f32 ]

A splat from kmem_cache_destroy() was seen with a kernel prior to
commit ee2653bbe89d ("iommu/vt-d: Remove domain and devinfo mempool")
when there was a failure in init_dmars(), because the iommu_domain
cache still had objects. While the mempool code is now gone, there
still is a leak of the si_domain memory if init_dmars() fails. So
clean up si_domain in the init_dmars() error path.

Cc: Lu Baolu <baolu.lu@linux.intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Will Deacon <will@kernel.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Fixes: 86080ccc223a ("iommu/vt-d: Allocate si_domain in init_dmars()")
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>
Link: https://lore.kernel.org/r/20221010144842.308890-1-jsnitsel@redhat.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/iommu/intel/iommu.c