mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: aggregator: remove the software node when deactivating the aggregator
@ 2026-05-20 12:16 Bartosz Golaszewski
  2026-05-21 12:38 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2026-05-20 12:16 UTC (permalink / raw)
  To: Geert Uytterhoeven, Linus Walleij, Bartosz Golaszewski, Koichiro Den
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski, Geert Uytterhoeven

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.

Fixes: 86f162e73d2d ("gpio: aggregator: introduce basic configfs interface")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/all/CAMuHMdVZ=XUvJTGdDAjnkxgtw7Uvnn61iOy3XN_5XNZM2anctw@mail.gmail.com/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/gpio/gpio-aggregator.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpio/gpio-aggregator.c b/drivers/gpio/gpio-aggregator.c
index 5915209e1e21..44f19f22fc30 100644
--- a/drivers/gpio/gpio-aggregator.c
+++ b/drivers/gpio/gpio-aggregator.c
@@ -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,
-- 
2.47.3


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

* Re: [PATCH] gpio: aggregator: remove the software node when deactivating the aggregator
  2026-05-20 12:16 [PATCH] gpio: aggregator: remove the software node when deactivating the aggregator Bartosz Golaszewski
@ 2026-05-21 12:38 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2026-05-21 12:38 UTC (permalink / raw)
  To: Geert Uytterhoeven, Linus Walleij, Bartosz Golaszewski,
	Koichiro Den, Bartosz Golaszewski
  Cc: linux-gpio, linux-kernel, Geert Uytterhoeven


On Wed, 20 May 2026 14:16:31 +0200, Bartosz Golaszewski wrote:
> 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,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

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

end of thread, other threads:[~2026-05-21 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-20 12:16 [PATCH] gpio: aggregator: remove the software node when deactivating the aggregator Bartosz Golaszewski
2026-05-21 12:38 ` Bartosz Golaszewski

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®