]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ACPI/IORT: Fix memory leak in iort_rmr_alloc_sids()
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 28 Aug 2025 11:22:43 +0000 (19:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Sep 2025 16:54:16 +0000 (18:54 +0200)
commit0daeb2e7189951150fa7d6cc0967346e33bcb3e2
treef82c90932b8d0e776fc02c43533a1e26d2f2fdfa
parentf4f26a208d43a17e1a1acc6d988beb86ef1913ba
ACPI/IORT: Fix memory leak in iort_rmr_alloc_sids()

commit f3ef7110924b897f4b79db9f7ac75d319ec09c4a upstream.

If krealloc_array() fails in iort_rmr_alloc_sids(), the function returns
NULL but does not free the original 'sids' allocation. This results in a
memory leak since the caller overwrites the original pointer with the
NULL return value.

Fixes: 491cf4a6735a ("ACPI/IORT: Add support to retrieve IORT RMR reserved regions")
Cc: <stable@vger.kernel.org> # 6.0.x
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Link: https://lore.kernel.org/r/20250828112243.61460-1-linmq006@gmail.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/arm64/iort.c