netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net: PATCH] net: dsa: add missing refcount decrementation
@ 2022-04-25  9:47 Marcin Wojtas
  2022-04-27 17:25 ` Vladimir Oltean
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Wojtas @ 2022-04-25  9:47 UTC (permalink / raw)
  To: linux-kernel, netdev
  Cc: davem, kuba, andrew, vivien.didelot, f.fainelli, olteanv,
	upstream, Marcin Wojtas

After obtaining the "phy-handle" node, decrementing
refcount is required. Fix that.

Fixes: a20f997010c4 ("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed")
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 net/dsa/port.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/dsa/port.c b/net/dsa/port.c
index 32d472a82241..cdc56ba11f52 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -1620,8 +1620,10 @@ int dsa_port_link_register_of(struct dsa_port *dp)
 			if (ds->ops->phylink_mac_link_down)
 				ds->ops->phylink_mac_link_down(ds, port,
 					MLO_AN_FIXED, PHY_INTERFACE_MODE_NA);
+			of_node_put(phy_np);
 			return dsa_port_phylink_register(dp);
 		}
+		of_node_put(phy_np);
 		return 0;
 	}
 
-- 
2.29.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-27 17:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-25  9:47 [net: PATCH] net: dsa: add missing refcount decrementation Marcin Wojtas
2022-04-27 17:25 ` Vladimir Oltean
2022-04-27 17:38   ` Marcin Wojtas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).