From: Hanjun Guo <guohanjun@huawei.com>
To: Qinglang Miao <miaoqinglang@huawei.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>
Cc: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ACPI: configfs: add missing check after configfs_register_default_group
Date: Wed, 13 Jan 2021 16:32:11 +0800 [thread overview]
Message-ID: <7e56bf92-9300-b685-10e0-1e2551a42f36@huawei.com> (raw)
In-Reply-To: <20210113073058.79506-1-miaoqinglang@huawei.com>
On 2021/1/13 15:30, Qinglang Miao wrote:
> A list_add corruption is reported by Hulk Robot like this:
> ==============
> list_add corruption.
> Call Trace:
> link_obj+0xc0/0x1c0
> link_group+0x21/0x140
> configfs_register_subsystem+0xdb/0x380
> acpi_configfs_init+0x25/0x1000 [acpi_configfs]
> do_one_initcall+0x149/0x820
> do_init_module+0x1ef/0x720
> load_module+0x35c8/0x4380
> __do_sys_finit_module+0x10d/0x1a0
> do_syscall_64+0x34/0x80
>
> It's because of the missing check after configfs_register_default_group,
> where configfs_unregister_subsystem should be called once failure.
I think it's right to call *_unregister_* for error path, but...
>
> Fixes: 612bd01fc6e0 ("ACPI: add support for loading SSDTs via configfs")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> ---
> drivers/acpi/acpi_configfs.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c
> index cf91f4910..25512ab0e 100644
> --- a/drivers/acpi/acpi_configfs.c
> +++ b/drivers/acpi/acpi_configfs.c
> @@ -268,7 +268,12 @@ static int __init acpi_configfs_init(void)
>
> acpi_table_group = configfs_register_default_group(root, "table",
> &acpi_tables_type);
> - return PTR_ERR_OR_ZERO(acpi_table_group);
> + if (IS_ERR(acpi_table_group)) {
> + configfs_register_subsystem(&acpi_configfs);
...
Typo here, s/register/unregister.
Thanks
Hanjun
prev parent reply other threads:[~2021-01-13 8:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 7:30 Qinglang Miao
2021-01-13 8:32 ` Hanjun Guo [this message]
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=7e56bf92-9300-b685-10e0-1e2551a42f36@huawei.com \
--to=guohanjun@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoqinglang@huawei.com \
--cc=rjw@rjwysocki.net \
/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
all inboxes | Powered by JetHome®