linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hanjun Guo <guohanjun@huawei.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: James Morse <james.morse@arm.com>,
	Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
	<linux-acpi@vger.kernel.org>, Hanjun Guo <guohanjun@huawei.com>
Subject: [PATCH 4/9] ACPI: APEI: Put the error injection table for error path and module exit
Date: Thu, 7 May 2020 17:09:16 +0800	[thread overview]
Message-ID: <1588842561-32907-5-git-send-email-guohanjun@huawei.com> (raw)
In-Reply-To: <1588842561-32907-1-git-send-email-guohanjun@huawei.com>

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>
---
 drivers/acpi/apei/einj.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index 086373f..13315675 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -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;
@@ -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;
 }
@@ -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);
-- 
1.7.12.4


  parent reply	other threads:[~2020-05-07  9:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07  9:09 [PATCH 0/9] ACPI: Call acpi_put_table() to release the ACPI table mappings Hanjun Guo
2020-05-07  9:09 ` [PATCH 1/9] ACPI: LPIT: Put the low power idle table after using it Hanjun Guo
2020-05-07  9:09 ` [PATCH 2/9] ACPI: watchdog: Put the watchdog action table after parsing Hanjun Guo
2020-05-07  9:09 ` [PATCH 3/9] ACPI: APEI: Put the boot error record " Hanjun Guo
2020-05-07  9:09 ` Hanjun Guo [this message]
2020-05-07  9:09 ` [PATCH 5/9] ACPI: APEI: Put the error record serialization table for error path Hanjun Guo
2020-05-07  9:09 ` [PATCH 6/9] ACPI: APEI: Put the HEST " Hanjun Guo
2020-05-07  9:09 ` [PATCH 7/9] ACPI: EC: Put the ACPI table after using it Hanjun Guo
2020-05-09  9:11   ` Rafael J. Wysocki
2020-05-09  9:30     ` Rafael J. Wysocki
2020-05-09  9:47       ` Hanjun Guo
2020-05-07  9:09 ` [PATCH 8/9] ACPI: scan: Put SPCR and STAO " Hanjun Guo
2020-05-07  9:09 ` [PATCH 9/9] ACPI: sleep: Put the FACS " Hanjun Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1588842561-32907-5-git-send-email-guohanjun@huawei.com \
    --to=guohanjun@huawei.com \
    --cc=bp@alien8.de \
    --cc=james.morse@arm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).