Skip to content

Commit

Permalink
HSI: omap_ssi: Fix refcount leak in ssi_probe
Browse files Browse the repository at this point in the history
[ Upstream commit 9a2ea13 ]

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: b209e04 ("HSI: Introduce OMAP SSI driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yuuoniy authored and gregkh committed Oct 21, 2022
1 parent 176876d commit 0eff9ef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hsi/controllers/omap_ssi_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 0eff9ef

Please sign in to comment.