]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: phy: fixed_phy: fix of_node leak in fixed_phy_unregister
authorJohan Hovold <johan@kernel.org>
Wed, 16 Nov 2016 14:20:38 +0000 (15:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Nov 2016 17:05:05 +0000 (12:05 -0500)
Make sure to drop the of_node reference taken in fixed_phy_register()
when deregistering a PHY.

Fixes: a75951217472 ("net: phy: extend fixed driver with
fixed_phy_register()")

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/fixed_phy.c

index c649c101bbaba97ec44255b9ee1e7a878c26ada5..eb51672106811e35ee0a7b3f0578560e16bc3670 100644 (file)
@@ -279,7 +279,7 @@ EXPORT_SYMBOL_GPL(fixed_phy_register);
 void fixed_phy_unregister(struct phy_device *phy)
 {
        phy_device_remove(phy);
-
+       of_node_put(phy->mdio.dev.of_node);
        fixed_phy_del(phy->mdio.addr);
 }
 EXPORT_SYMBOL_GPL(fixed_phy_unregister);