Skip to content

Commit

Permalink
ACPI: APEI: Put the error injection table for error path and module exit
Browse files Browse the repository at this point in the history
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 <guohanjun@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Hanjun Guo authored and Rafael J. Wysocki committed May 9, 2020
1 parent 3d995f8 commit 541156a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/acpi/apei/einj.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ static int __init einj_init(void)
rc = einj_check_table(einj_tab);
if (rc) {
pr_warn(FW_BUG "Invalid EINJ table.\n");
return -EINVAL;
goto err_put_table;
}

rc = -ENOMEM;
Expand Down Expand Up @@ -760,6 +760,8 @@ static int __init einj_init(void)
err_fini:
apei_resources_fini(&einj_resources);
debugfs_remove_recursive(einj_debug_dir);
err_put_table:
acpi_put_table((struct acpi_table_header *)einj_tab);

return rc;
}
Expand All @@ -780,6 +782,7 @@ static void __exit einj_exit(void)
apei_resources_release(&einj_resources);
apei_resources_fini(&einj_resources);
debugfs_remove_recursive(einj_debug_dir);
acpi_put_table((struct acpi_table_header *)einj_tab);
}

module_init(einj_init);
Expand Down

0 comments on commit 541156a

Please sign in to comment.