From: Zhen Ni Date: Fri, 22 Aug 2025 02:49:15 +0000 (+0800) Subject: iommu/amd: Fix ivrs_base memleak in early_amd_iommu_init() X-Git-Tag: v6.17-rc7~7^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=923b70581cb6acede90f8aaf4afe5d1c58c67b71;p=thirdparty%2Fkernel%2Fstable.git iommu/amd: Fix ivrs_base memleak in early_amd_iommu_init() Fix a permanent ACPI table memory leak in early_amd_iommu_init() when CMPXCHG16B feature is not supported Fixes: 82582f85ed22 ("iommu/amd: Disable AMD IOMMU if CMPXCHG16B feature is not supported") Cc: stable@vger.kernel.org Signed-off-by: Zhen Ni Reviewed-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20250822024915.673427-1-zhen.ni@easystack.cn Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index 8de689b2c5ed5..6795326a6524b 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -3067,7 +3067,8 @@ static int __init early_amd_iommu_init(void) if (!boot_cpu_has(X86_FEATURE_CX16)) { pr_err("Failed to initialize. The CMPXCHG16B feature is required.\n"); - return -EINVAL; + ret = -EINVAL; + goto out; } /*