[PATCH] dmaengine: mv_xor: Call of_node_put() when breaking out of for_each_child_of_node()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux