diff mbox series

[11/11] media: platform: mtk-mdp3: add missing of_node_put

Message ID 20230907095521.14053-12-Julia.Lawall@inria.fr (mailing list archive)
State New, archived
Headers show
Series add missing of_node_put | expand

Commit Message

Julia Lawall Sept. 7, 2023, 9:55 a.m. UTC
for_each_child_of_node performs an of_node_get on each
iteration, so a break out of the loop requires an
of_node_put.

This was done using the Coccinelle semantic patch
iterators/for_each_child.cocci

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c |    1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff -u -p a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c
@@ -1137,6 +1137,7 @@  int mdp_comp_config(struct mdp_dev *mdp)
 		comp = mdp_comp_create(mdp, node, id);
 		if (IS_ERR(comp)) {
 			ret = PTR_ERR(comp);
+			of_node_put(node);
 			goto err_init_comps;
 		}