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

Julia Lawall Julia.Lawall at inria.fr
Thu Sep 7 02:55:21 PDT 2023


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 at inria.fr>

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

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;
 		}
 




More information about the Linux-mediatek mailing list