From: Jing Xiangfeng <jingxiangfeng@huawei.com>
To: <rjw@rjwysocki.net>, <lenb@kernel.org>, <rui.zhang@intel.com>,
<guohanjun@huawei.com>
Cc: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<jingxiangfeng@huawei.com>
Subject: [PATCH v2] ACPI: FPDT: Add the missed acpi_put_table() in acpi_init_fpdt()
Date: Wed, 2 Jun 2021 19:58:12 +0800 [thread overview]
Message-ID: <20210602115812.109900-1-jingxiangfeng@huawei.com> (raw)
acpi_init_fpdt() misses to call acpi_put_table() in an error path. Add
the missed function call to fix it.
Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT table")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
---
v1 -> v2:
- Collect Acked-by tag by Zhang Rui.
- retitle the subject as suggested by Hanjun Guo.
---
drivers/acpi/acpi_fpdt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c
index a89a806a7a2a..4ee2ad234e3d 100644
--- a/drivers/acpi/acpi_fpdt.c
+++ b/drivers/acpi/acpi_fpdt.c
@@ -240,8 +240,10 @@ static int __init acpi_init_fpdt(void)
return 0;
fpdt_kobj = kobject_create_and_add("fpdt", acpi_kobj);
- if (!fpdt_kobj)
+ if (!fpdt_kobj) {
+ acpi_put_table(header);
return -ENOMEM;
+ }
while (offset < header->length) {
subtable = (void *)header + offset;
--
2.26.0.106.g9fadedd
next reply other threads:[~2021-06-02 11:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 11:58 Jing Xiangfeng [this message]
2021-06-03 1:02 ` [PATCH v2] ACPI: FPDT: Add the missed acpi_put_table() in acpi_init_fpdt() Hanjun Guo
2021-06-07 13:59 ` Rafael J. Wysocki
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=20210602115812.109900-1-jingxiangfeng@huawei.com \
--to=jingxiangfeng@huawei.com \
--cc=guohanjun@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@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).