ASoC: rsnd: add missing of_node_put
authorJulia Lawall <Julia.Lawall@inria.fr>
Thu, 7 Sep 2023 09:55:20 +0000 (11:55 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 11 Sep 2023 00:23:54 +0000 (01:23 +0100)
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>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20230907095521.14053-11-Julia.Lawall@inria.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/core.c

index e29c2fee9521943bd961b5725b30a9024a00e72b..1bd7114c472a8bb8c9032a599b0da385710ee820 100644 (file)
@@ -1303,6 +1303,7 @@ audio_graph:
                if (i >= RSND_MAX_COMPONENT) {
                        dev_info(dev, "reach to max component\n");
                        of_node_put(node);
+                       of_node_put(ports);
                        break;
                }
        }