Skip to contentSkip to conversation

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

PATCH Applied Hanjun Guo 2 participants 2 messages Sep 18, 2020 – Sep 25, 2020 ACPI

lore
Share & tools
lore

Hanjun Guo

author
#0 lore raw

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

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")
---
 drivers/acpi/acpi_configfs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpi_configfs.c +1 -0
index 88c8af4..cf91f49 100644
@@ -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 = {
Signature · 1 line
1.7.12.4
maintainer Applied
#1 lore raw
Quoted 15 lines · 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")
---
 drivers/acpi/acpi_configfs.c | 1 +
 1 file changed, 1 insertion(+)
drivers/acpi/acpi_configfs.c +0 -0
index 88c8af4..cf91f49 100644

drivers/acpi/acpi_configfs.c static void acpi_table_drop_item(struct config_group *group,

Quoted 8 lines
drivers/acpi/acpi_configfs.c +1 -1
@@ -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!