Skip to contentSkip to conversation

gpio: aggregator: remove the software node when deactivating the aggregator

PATCH Applied Bartosz Golaszewski 1 participant 2 messages May 20 – May 21

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: aggregator: remove the software node when deactivating the aggregator

The dynamic software node we create for the aggregator platform device when using configfs is leaked when the device is deactivated. Destroy it as the last step in the tear-down path.

---
 drivers/gpio/gpio-aggregator.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpio/gpio-aggregator.c +4 -0
index 5915209e1e21..44f19f22fc30 100644
@@ -991,11 +991,15 @@ static int gpio_aggregator_activate(struct gpio_aggregator *aggr)
 
 static void gpio_aggregator_deactivate(struct gpio_aggregator *aggr)
 {
+	struct fwnode_handle *swnode;
+
+	swnode = dev_fwnode(&aggr->pdev->dev);
 	platform_device_unregister(aggr->pdev);
 	aggr->pdev = NULL;
 	gpiod_remove_lookup_table(aggr->lookups);
 	kfree(aggr->lookups->dev_id);
 	kfree(aggr->lookups);
+	fwnode_remove_software_node(swnode);
 }
 
 static void gpio_aggregator_lockup_configfs(struct gpio_aggregator *aggr,
Signature · 1 line
2.47.3
author Applied
#1 lore raw
Quoted 5 lines · Bartosz Golaszewski

The dynamic software node we create for the aggregator platform device when using configfs is leaked when the device is deactivated. Destroy it as the last step in the tear-down path.

Applied, thanks!

[1/1] gpio: aggregator: remove the software node when deactivating the aggregator

      https://git.kernel.org/brgl/c/61fef83f239ecace1cce716135762a2d9b7b1fc6

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>