Skip to contentSkip to conversation

gpio: mvebu: free generic chips on unbind

PATCH Applied Rosen Penev 2 participants 2 messages Jul 7 – Jul 8 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: mvebu: free generic chips on unbind

irq_alloc_domain_generic_chips() allocates generic chip data that must be freed via irq_domain_remove_generic_chips(). The devres action mvebu_gpio_remove_irq_domain() only called irq_domain_remove(), which only frees the generic chips if IRQ_DOMAIN_FLAG_DESTROY_GC is set. Call irq_domain_remove_generic_chips() explicitly before irq_domain_remove() instead.

Fixes 812d47889a8e ("gpio/mvebu: Use irq_domain_add_linear")
Assisted-by opencode:big-pickle
---
 drivers/gpio/gpio-mvebu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-mvebu.c +1 -0
index 93568bc78437..236dd2d91d3e 100644
@@ -1139,6 +1139,7 @@ static void mvebu_gpio_remove_irq_domain(void *data)
 {
 	struct irq_domain *domain = data;
 
+	irq_domain_remove_generic_chips(domain);
 	irq_domain_remove(domain);
 }
 
Signature · 1 line
2.55.0
#1 lore raw
Quoted 8 lines · Rosen Penev

irq_alloc_domain_generic_chips() allocates generic chip data that must be freed via irq_domain_remove_generic_chips(). The devres action mvebu_gpio_remove_irq_domain() only called irq_domain_remove(), which only frees the generic chips if IRQ_DOMAIN_FLAG_DESTROY_GC is set. Call irq_domain_remove_generic_chips() explicitly before irq_domain_remove() instead.

[...]

Applied, thanks!

[1/1] gpio: mvebu: free generic chips on unbind

      https://git.kernel.org/brgl/c/b11c513ad943f35cf5e8007d3a56279c79b7ed4b

Best regards,

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