Fixes a permanent ACPI table memory leak when einj_probe() return 0 by adding acpi_put_table(). Remove the assignment rc = -ENOMEM to allow the function to propagate the actual return value.
Fixes: e40213450b53 ("ACPI, APEI, EINJ support") Cc: stable@vger.kernel.org Signed-off-by: Zhen Ni zhen.ni@easystack.cn --- drivers/acpi/apei/einj-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index bf8dc92a373a..919caa819cf8 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -990,7 +990,7 @@ static bool setup_einjv2_component_files(void)
static int __init einj_probe(struct faux_device *fdev) { - int rc; + int rc = 0; acpi_status status; struct apei_exec_context ctx;
@@ -1015,7 +1015,6 @@ static int __init einj_probe(struct faux_device *fdev) if (rc) goto err_put_table;
- rc = -ENOMEM; einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir());
debugfs_create_file("available_error_type", S_IRUSR, einj_debug_dir, @@ -1078,7 +1077,7 @@ static int __init einj_probe(struct faux_device *fdev)
pr_info("Error INJection is initialized.\n");
- return 0; + goto err_put_table;
err_release: apei_resources_release(&einj_resources);
在 2025/8/7 19:56, Zhen Ni 写道:
Fixes a permanent ACPI table memory leak when einj_probe() return 0 by adding acpi_put_table(). Remove the assignment rc = -ENOMEM to allow the function to propagate the actual return value.
Fixes: e40213450b53 ("ACPI, APEI, EINJ support") Cc: stable@vger.kernel.org Signed-off-by: Zhen Ni zhen.ni@easystack.cn ...
I need to withdraw this patch because upon further investigation, the issue it attempted to fix does not actually exist.
My apologies for the noise. Please disregard the original patch.
Best regards, Zhen
linux-stable-mirror@lists.linaro.org