All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: mv_xor: Call of_node_put() when breaking out of for_each_child_of_node()
@ 2022-07-08  9:27 Liang He
  0 siblings, 0 replies; only message in thread
From: Liang He @ 2022-07-08  9:27 UTC (permalink / raw)
  To: vkoul, dmaengine, windhl

In mv_xor_probe(), for_each_child_of_node() will automatically
increase and decrease the refcount. We should call of_node_put()
when breaking out of the iteration.

Fixes: f7d12ef53ddf ("dma: mv_xor: add Device Tree binding")
Signed-off-by: Liang He <windhl@126.com>
---
 drivers/dma/mv_xor.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 23b232b57518..3a5c87f992d1 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1392,6 +1392,7 @@ static int mv_xor_probe(struct platform_device *pdev)
 
 			irq = irq_of_parse_and_map(np, 0);
 			if (!irq) {
+				of_node_put(np);
 				ret = -ENODEV;
 				goto err_channel_add;
 			}
@@ -1399,6 +1400,7 @@ static int mv_xor_probe(struct platform_device *pdev)
 			chan = mv_xor_channel_add(xordev, pdev, i,
 						  cap_mask, irq);
 			if (IS_ERR(chan)) {
+				of_node_put(np);
 				ret = PTR_ERR(chan);
 				irq_dispose_mapping(irq);
 				goto err_channel_add;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-08  9:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08  9:27 [PATCH] dmaengine: mv_xor: Call of_node_put() when breaking out of for_each_child_of_node() Liang He

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.