Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0da60541 authored by Johan Hovold's avatar Johan Hovold Committed by David S. Miller
Browse files

net: bcmgenet: fix phydev reference leak



Make sure to drop the reference taken by of_phy_find_device() when
initialising MOCA PHYs.

Fixes: 6ac9de5f ("net: bcmgenet: Register link_update callback for
all MoCA PHYs")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd05d7b1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -542,8 +542,10 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)
	/* Make sure we initialize MoCA PHYs with a link down */
	if (phy_mode == PHY_INTERFACE_MODE_MOCA) {
		phydev = of_phy_find_device(dn);
		if (phydev)
		if (phydev) {
			phydev->link = 0;
			put_device(&phydev->mdio.dev);
		}
	}

	return 0;