diff mbox series

ASoC: rsnd: call of_node_put() when break

Message ID 87bkfh9g68.wl-kuninori.morimoto.gx@renesas.com
State Accepted
Commit 1a5ca2aad7b907f9d7101eaba7dfa068b2da3bdd
Headers show
Series ASoC: rsnd: call of_node_put() when break | expand

Commit Message

Kuninori Morimoto Aug. 9, 2023, 1:07 a.m. UTC
We need to call of_node_put() when break from
for_each_child_of_node(). This patch add missing
of_node_put().

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/core.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 069add7b1b71..e29c2fee9521 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1282,6 +1282,7 @@  static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph)
 		i++;
 		if (i >= RSND_MAX_COMPONENT) {
 			dev_info(dev, "reach to max component\n");
+			of_node_put(node);
 			break;
 		}
 	}
@@ -1301,6 +1302,7 @@  static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph)
 		i++;
 		if (i >= RSND_MAX_COMPONENT) {
 			dev_info(dev, "reach to max component\n");
+			of_node_put(node);
 			break;
 		}
 	}