]> git.baikalelectronics.ru Git - 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Oct 2022 08:20:35 +0000 (10:20 +0200)
commita8f53afc2d01e61314940ee1b1f8e7336eeb65cc
treeb5055655bf907001ad2e86e445b8477b962d66cc
parent6ee3ed171f58ee0850975ec97a894a4e270dc367
iommu/vt-d: Clean up si_domain in the init_dmars() error path

[ Upstream commit 411509e268fdd2b467eadcd8998acf53190f2d81 ]

A splat from kmem_cache_destroy() was seen with a kernel prior to
commit 63732bd5b1da ("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: 06d3c36fce55 ("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>
drivers/iommu/intel-iommu.c