Commit f3956e30 authored by Wan Jiabing's avatar Wan Jiabing Committed by Jakub Kicinski

net: dsa: sja1105: Add of_node_put() before return

Fix following coccicheck warning:
./drivers/net/dsa/sja1105/sja1105_main.c:1193:1-33: WARNING: Function
for_each_available_child_of_node should have of_node_put() before return.

Early exits from for_each_available_child_of_node should decrement the
node reference counter.

Fixes: 9ca482a2 ("net: dsa: sja1105: parse {rx, tx}-internal-delay-ps properties for RGMII delays")
Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
Link: https://lore.kernel.org/r/20211021094606.7118-1-wanjiabing@vivo.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 47b06824
...@@ -1233,8 +1233,10 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv, ...@@ -1233,8 +1233,10 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv,
priv->phy_mode[index] = phy_mode; priv->phy_mode[index] = phy_mode;
err = sja1105_parse_rgmii_delays(priv, index, child); err = sja1105_parse_rgmii_delays(priv, index, child);
if (err) if (err) {
of_node_put(child);
return err; return err;
}
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment