Skip to content

Commit 541156a

Browse files
guohanjunrafaeljw
authored andcommitted
ACPI: APEI: Put the error injection table for error path and module exit
The mapped error injection table will be used after einj_init() for debugfs, but it should be released for module exit and error path of einj_init(). Signed-off-by: Hanjun Guo <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 3d995f8 commit 541156a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/acpi/apei/einj.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ static int __init einj_init(void)
692692
rc = einj_check_table(einj_tab);
693693
if (rc) {
694694
pr_warn(FW_BUG "Invalid EINJ table.\n");
695-
return -EINVAL;
695+
goto err_put_table;
696696
}
697697

698698
rc = -ENOMEM;
@@ -760,6 +760,8 @@ static int __init einj_init(void)
760760
err_fini:
761761
apei_resources_fini(&einj_resources);
762762
debugfs_remove_recursive(einj_debug_dir);
763+
err_put_table:
764+
acpi_put_table((struct acpi_table_header *)einj_tab);
763765

764766
return rc;
765767
}
@@ -780,6 +782,7 @@ static void __exit einj_exit(void)
780782
apei_resources_release(&einj_resources);
781783
apei_resources_fini(&einj_resources);
782784
debugfs_remove_recursive(einj_debug_dir);
785+
acpi_put_table((struct acpi_table_header *)einj_tab);
783786
}
784787

785788
module_init(einj_init);

0 commit comments

Comments
 (0)