Skip to contentSkip to conversation

ASoC: rsnd: Add of_node_put() before return

PATCH New Wan Jiabing 1 participant 1 message Oct 15, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: rsnd: Add of_node_put() before return

Fix following coccicheck warning:
./sound/soc/sh/rcar/core.c:1223:1-23: WARNING: Function for_each_child_of_node should have of_node_put() before return

Early exits from for_each_child_of_node should decrement the node reference counter.

---
 sound/soc/sh/rcar/core.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/sh/rcar/core.c +1 -0
index 978bd0406729..6a8fe0da7670 100644
@@ -1225,6 +1225,7 @@ int rsnd_node_count(struct rsnd_priv *priv, struct device_node *node, char *name
 		if (i < 0) {
 			dev_err(dev, "strange node numbering (%s)",
 				of_node_full_name(node));
+			of_node_put(np);
 			return 0;
 		}
 		i++;
Signature · 1 line
2.20.1