summaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/sja1105
diff options
context:
space:
mode:
authorWan Jiabing <wanjiabing@vivo.com>2021-10-21 05:46:06 -0400
committerJakub Kicinski <kuba@kernel.org>2021-10-22 14:05:55 -0700
commitf3956e309ecc57940de031987e49a92b131315f7 (patch)
tree3fb40522ebdc0583de8c4ccd94072be69d84f227 /drivers/net/dsa/sja1105
parent47b068247aa7d76bb7abea796b72e18a4c6e35c3 (diff)
downloadlinux-f3956e309ecc57940de031987e49a92b131315f7.tar.gz
linux-f3956e309ecc57940de031987e49a92b131315f7.tar.bz2
linux-f3956e309ecc57940de031987e49a92b131315f7.zip
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: 9ca482a246f0 ("net: dsa: sja1105: parse {rx, tx}-internal-delay-ps properties for RGMII delays") Signed-off-by: Wan Jiabing <wanjiabing@vivo.com> Link: https://lore.kernel.org/r/20211021094606.7118-1-wanjiabing@vivo.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/sja1105')
-rw-r--r--drivers/net/dsa/sja1105/sja1105_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index 1832d4bd3440..70ece441b3b8 100644
--- a/drivers/net/dsa/sja1105/sja1105_main.c
+++ b/drivers/net/dsa/sja1105/sja1105_main.c
@@ -1233,8 +1233,10 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv,
priv->phy_mode[index] = phy_mode;
err = sja1105_parse_rgmii_delays(priv, index, child);
- if (err)
+ if (err) {
+ of_node_put(child);
return err;
+ }
}
return 0;