mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soc: ti: knav_dma: Fix device node leak in of_channel_match_helper()
@ 2026-11-10 10:11 zhaofeng2
  2026-11-20 16:06 ` Nishanth Menon
  2026-11-23  6:50 ` [PATCH v2] soc: ti: knav_dma: fix " zhaofeng2
  0 siblings, 2 replies; 4+ messages in thread
From: zhaofeng2 @ 2026-11-10 10:11 UTC (permalink / raw)
  To: Nishanth Menon, Santosh Shilimkar
  Cc: Zhao Feng, linux-arm-kernel, linux-kernel

From: Zhao Feng <zhaofeng2@cmss.chinamobile.com>

of_channel_match_helper() resolves the "ti,navigator-dmas" phandle
with of_parse_phandle_with_fixed_args() to obtain the channel number,
which takes a reference on the dma device node in args.np, but the
reference is never dropped after the channel number has been read
from args.args[0], so the dma node is leaked on every channel open.

Drop the reference once the channel number has been retrieved.  The
phandle stored in dma_node is deliberately kept, as its ->name string
is handed out through *dma_instance and compared against later in
knav_dma_open_channel().

Fixes: 88139ed03058 ("soc: ti: add Keystone Navigator DMA support")
Signed-off-by: Zhao Feng <zhaofeng2@cmss.chinamobile.com>
---
 drivers/soc/ti/knav_dma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c
--- a/drivers/soc/ti/knav_dma.c
+++ b/drivers/soc/ti/knav_dma.c
@@ -387,6 +387,8 @@
 		return -ENODEV;
 	}
 
+	of_node_put(args.np);
+
 	return args.args[0];
 }
 



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

end of thread, other threads:[~2026-12-03 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10 10:11 [PATCH] soc: ti: knav_dma: Fix device node leak in of_channel_match_helper() zhaofeng2
2026-11-20 16:06 ` Nishanth Menon
2026-11-23  6:50 ` [PATCH v2] soc: ti: knav_dma: fix " zhaofeng2
2026-12-03 16:08   ` Andrew Davis

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®