summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiaoqian Lin <linmq006@gmail.com>2022-04-04 08:52:32 +0000
committerSebastian Reichel <sre@kernel.org>2022-04-12 11:58:54 +0200
commit43c14f8d18a7ab26e8f0e960bfd8f4d0a9c57c4d (patch)
treefb52a0506700c773768706479d7c394d861c298d
parent2660e71e6080a53aeaaa9d79e7ed9d8d72dd63ae (diff)
downloadlinux-next-43c14f8d18a7ab26e8f0e960bfd8f4d0a9c57c4d.tar.gz
linux-next-43c14f8d18a7ab26e8f0e960bfd8f4d0a9c57c4d.zip
HSI: omap_ssi: Fix refcount leak in ssi_probe
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> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-rw-r--r--drivers/hsi/controllers/omap_ssi_core.c1
1 files changed, 1 insertions, 0 deletions
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;
}
}