diff mbox series

ACPI: configfs: Add the missing config_item_put() to fix refcount leak

Message ID 1600420408-62807-1-git-send-email-guohanjun@huawei.com
State Accepted
Commit 9a2e849fb6de471b82d19989a7944d3b7671793c
Headers show
Series ACPI: configfs: Add the missing config_item_put() to fix refcount leak | expand

Commit Message

Hanjun Guo Sept. 18, 2020, 9:13 a.m. UTC
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(+)

Comments

Rafael J. Wysocki Sept. 25, 2020, 4:09 p.m. UTC | #1
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!
diff mbox series

Patch

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 = {