mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] of/irq: Fix remaining refcount leaks in of_irq_init()
@ 2026-09-17 12:42 Wentao Liang
  2026-09-30 21:09 ` Rob Herring (Arm)
  0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-09-17 12:42 UTC (permalink / raw)
  To: Julia.Lawall
  Cc: devicetree, linux-kernel, robh, saravanak, Wentao Liang, stable

Successfully initialized controllers are moved to intc_parent_list,
but the final cleanup only frees the descriptors. The device node
references taken with of_node_get() and the interrupt parent
references are therefore leaked on the normal return path. Drop both
before kfree(), as the intc_desc_list cleanup already does.

Fixes: 8363ccb917c6 ("of/irq: add missing of_node_put")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/of/irq.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 6367c67732d2..f50fec3afa2e 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -752,6 +752,8 @@ void __init of_irq_init(const struct of_device_id *matches)
 
 	list_for_each_entry_safe(desc, temp_desc, &intc_parent_list, list) {
 		list_del(&desc->list);
+		of_node_put(desc->interrupt_parent);
+		of_node_put(desc->dev);
 		kfree(desc);
 	}
 err:
-- 
2.34.1


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

* Re: [PATCH] of/irq: Fix remaining refcount leaks in of_irq_init()
  2026-09-17 12:42 [PATCH] of/irq: Fix remaining refcount leaks in of_irq_init() Wentao Liang
@ 2026-09-30 21:09 ` Rob Herring (Arm)
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring (Arm) @ 2026-09-30 21:09 UTC (permalink / raw)
  To: Wentao Liang; +Cc: saravanak, devicetree, Julia.Lawall, linux-kernel, stable


On Thu, 17 Sep 2026 12:42:47 +0000, Wentao Liang wrote:
> Successfully initialized controllers are moved to intc_parent_list,
> but the final cleanup only frees the descriptors. The device node
> references taken with of_node_get() and the interrupt parent
> references are therefore leaked on the normal return path. Drop both
> before kfree(), as the intc_desc_list cleanup already does.
> 
> Fixes: 8363ccb917c6 ("of/irq: add missing of_node_put")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>  drivers/of/irq.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

Applied, thanks!


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

end of thread, other threads:[~2026-09-30 21:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 12:42 [PATCH] of/irq: Fix remaining refcount leaks in of_irq_init() Wentao Liang
2026-09-30 21:09 ` Rob Herring (Arm)

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®