This is a note to let you know that I've just added the patch titled net: ethernet: marvell: mvneta: fix fixed-link phydev leaks to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-ethernet-marvell-mvneta-fix-fixed-link-phydev-leaks.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 5a57a304315c09f9f93b7b7230a5038555e7fcf9 Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan@xxxxxxxxxx> Date: Mon, 28 Nov 2016 19:25:04 +0100 Subject: net: ethernet: marvell: mvneta: fix fixed-link phydev leaks From: Johan Hovold <johan@xxxxxxxxxx> commit 5a57a304315c09f9f93b7b7230a5038555e7fcf9 upstream. Make sure to deregister and free any fixed-link PHY registered using of_phy_register_fixed_link() on probe errors and on driver unbind. Fixes: 83895bedeee6 ("net: mvneta: add support for fixed links") Signed-off-by: Johan Hovold <johan@xxxxxxxxxx> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@xxxxxxxxxxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/ethernet/marvell/mvneta.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -3438,6 +3438,8 @@ err_clk: clk_disable_unprepare(pp->clk); err_put_phy_node: of_node_put(phy_node); + if (of_phy_is_fixed_link(dn)) + of_phy_deregister_fixed_link(dn); err_free_irq: irq_dispose_mapping(dev->irq); err_free_netdev: @@ -3449,12 +3451,15 @@ err_free_netdev: static int mvneta_remove(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); + struct device_node *dn = pdev->dev.of_node; struct mvneta_port *pp = netdev_priv(dev); unregister_netdev(dev); clk_disable_unprepare(pp->clk); free_percpu(pp->ports); free_percpu(pp->stats); + if (of_phy_is_fixed_link(dn)) + of_phy_deregister_fixed_link(dn); irq_dispose_mapping(dev->irq); of_node_put(pp->phy_node); free_netdev(dev); Patches currently in stable-queue which might be from johan@xxxxxxxxxx are queue-4.4/of_mdio-fix-node-leak-in-of_phy_register_fixed_link-error-path.patch queue-4.4/net-ethernet-gianfar-fix-fixed-link-phydev-leaks.patch queue-4.4/net-ethernet-ucc_geth-fix-fixed-link-phydev-leaks.patch queue-4.4/phy-fix-device-reference-leaks.patch queue-4.4/net-dsa-slave-fix-of-node-leak-and-phy-priority.patch queue-4.4/net-ethernet-marvell-mvneta-fix-fixed-link-phydev-leaks.patch queue-4.4/net-ethernet-fs_enet-fix-fixed-link-phydev-leaks.patch