ACPI: APEI: EINJ: Fix einj_tab memleak in einj_probe()
Subsystems (3)
PATCH 1/1 ACPI: APEI: EINJ: Fix einj_tab memleak in einj_probe()
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")
Signed-off-by Zhen Ni <[email protected]>
--- drivers/acpi/apei/einj-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/acpi/apei/einj-core.c +2 -3
@@ -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);
Signature · 1 line
2.20.1
Quoted 9 lines · Zhen Ni
Fixes a permanent ACPI table memory leak when
einj_probe()return 0 by addingacpi_put_table().
Remove the assignment rc =-ENOMEMto allow the function to propagate the actual return value.Fixes e40213450b53 ("ACPI, APEI, EINJ support")Signed-off-by Zhen Ni <[email protected]>...
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