Commit 9d28f949 authored by Rosen Penev's avatar Rosen Penev Committed by Jakub Kicinski
Browse files

net: thunder_bgx: add a missing of_node_put



phy_np needs to get freed, just like the other child nodes.

Fixes: 5fc7cf17 ("net: thunderx: Cleanup PHY probing code.")
Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250901213018.47392-1-rosenp@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3bc32fd9
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -1493,14 +1493,18 @@ static int bgx_init_of_phy(struct bgx *bgx)
		 * this cortina phy, for which there is no driver
		 * support, ignore it.
		 */
		if (phy_np &&
		    !of_device_is_compatible(phy_np, "cortina,cs4223-slice")) {
		if (phy_np) {
			if (!of_device_is_compatible(phy_np, "cortina,cs4223-slice")) {
				/* Wait until the phy drivers are available */
				pd = of_phy_find_device(phy_np);
			if (!pd)
				if (!pd) {
					of_node_put(phy_np);
					goto defer;
				}
				bgx->lmac[lmac].phydev = pd;
			}
			of_node_put(phy_np);
		}

		lmac++;
		if (lmac == bgx->max_lmac) {