mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] HSI: omap_ssi: Fix refcount leak in ssi_probe
@ 2022-04-04  8:52 Miaoqian Lin
  2022-04-12 10:00 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-04-04  8:52 UTC (permalink / raw)
  To: Sebastian Reichel, Miaoqian Lin, Carlos Chinea, linux-kernel

When returning or breaking early from a
for_each_available_child_of_node() loop, we need to explicitly call
of_node_put() on the child node to possibly release the node.

Fixes: b209e047bc74 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 drivers/hsi/controllers/omap_ssi_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c
index 44a3f5660c10..eb9820158318 100644
--- a/drivers/hsi/controllers/omap_ssi_core.c
+++ b/drivers/hsi/controllers/omap_ssi_core.c
@@ -524,6 +524,7 @@ static int ssi_probe(struct platform_device *pd)
 		if (!childpdev) {
 			err = -ENODEV;
 			dev_err(&pd->dev, "failed to create ssi controller port\n");
+			of_node_put(child);
 			goto out3;
 		}
 	}
-- 
2.17.1


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

end of thread, other threads:[~2022-04-12 11:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04  8:52 [PATCH] HSI: omap_ssi: Fix refcount leak in ssi_probe Miaoqian Lin
2022-04-12 10:00 ` Sebastian Reichel

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®