linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: configfs: Add the missing config_item_put() to fix refcount leak
@ 2020-09-18  9:13 Hanjun Guo
  2020-09-25 16:09 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Hanjun Guo @ 2020-09-18  9:13 UTC (permalink / raw)
  To: linux-acpi; +Cc: Rafael J. Wysocki, Hanjun Guo

config_item_put() should be called in the drop_item callback, to
decrement refcount for the config item.

Fixes: 772bf1e2878ec ("ACPI: configfs: Unload SSDT on configfs entry removal")
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
 drivers/acpi/acpi_configfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c
index 88c8af4..cf91f49 100644
--- a/drivers/acpi/acpi_configfs.c
+++ b/drivers/acpi/acpi_configfs.c
@@ -228,6 +228,7 @@ static void acpi_table_drop_item(struct config_group *group,
 
 	ACPI_INFO(("Host-directed Dynamic ACPI Table Unload"));
 	acpi_unload_table(table->index);
+	config_item_put(cfg);
 }
 
 static struct configfs_group_operations acpi_table_group_ops = {
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI: configfs: Add the missing config_item_put() to fix refcount leak
  2020-09-18  9:13 [PATCH] ACPI: configfs: Add the missing config_item_put() to fix refcount leak Hanjun Guo
@ 2020-09-25 16:09 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2020-09-25 16:09 UTC (permalink / raw)
  To: Hanjun Guo; +Cc: ACPI Devel Maling List, Rafael J. Wysocki

On Fri, Sep 18, 2020 at 11:21 AM Hanjun Guo <guohanjun@huawei.com> wrote:
>
> config_item_put() should be called in the drop_item callback, to
> decrement refcount for the config item.
>
> Fixes: 772bf1e2878ec ("ACPI: configfs: Unload SSDT on configfs entry removal")
> Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
> ---
>  drivers/acpi/acpi_configfs.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/acpi/acpi_configfs.c b/drivers/acpi/acpi_configfs.c
> index 88c8af4..cf91f49 100644
> --- a/drivers/acpi/acpi_configfs.c
> +++ b/drivers/acpi/acpi_configfs.c
> @@ -228,6 +228,7 @@ static void acpi_table_drop_item(struct config_group *group,
>
>         ACPI_INFO(("Host-directed Dynamic ACPI Table Unload"));
>         acpi_unload_table(table->index);
> +       config_item_put(cfg);
>  }
>
>  static struct configfs_group_operations acpi_table_group_ops = {
> --

Applied as 5.10 material with a minor edit in the subject, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-25 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18  9:13 [PATCH] ACPI: configfs: Add the missing config_item_put() to fix refcount leak Hanjun Guo
2020-09-25 16:09 ` Rafael J. Wysocki

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).