diff options
author | Johan Hovold <johan@kernel.org> | 2016-11-24 19:21:28 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-27 20:01:15 -0500 |
commit | 0da60541f8a771270d310a574cb0adeefcdebcb1 (patch) | |
tree | 30d5022e74f4d8d7548a4ada642009b12f59f74a | |
parent | fd05d7b18cec1af043990c4b3aabc6780575375c (diff) | |
download | linux-stable-0da60541f8a771270d310a574cb0adeefcdebcb1.tar.gz linux-stable-0da60541f8a771270d310a574cb0adeefcdebcb1.tar.bz2 linux-stable-0da60541f8a771270d310a574cb0adeefcdebcb1.zip |
net: bcmgenet: fix phydev reference leak
Make sure to drop the reference taken by of_phy_find_device() when
initialising MOCA PHYs.
Fixes: 6ac9de5f6563 ("net: bcmgenet: Register link_update callback for
all MoCA PHYs")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmmii.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index 457c3bc8cfff..2e745bd51df4 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -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; |