Patch "net: ethernet: fs_enet: fix fixed-link phydev leaks" has been added to the 4.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: ethernet: fs_enet: 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-fs_enet-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 b9755f03728b21c36375a47a6c6366e00b4f2062 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@xxxxxxxxxx>
Date: Mon, 28 Nov 2016 19:25:01 +0100
Subject: net: ethernet: fs_enet: fix fixed-link phydev leaks

From: Johan Hovold <johan@xxxxxxxxxx>

commit b9755f03728b21c36375a47a6c6366e00b4f2062 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: bb74d9a4a87b ("fs_enet: use the new fixed PHY helpers")
Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -996,7 +996,7 @@ static int fs_enet_probe(struct platform
 		err = clk_prepare_enable(clk);
 		if (err) {
 			ret = err;
-			goto out_free_fpi;
+			goto out_deregister_fixed_link;
 		}
 		fpi->clk_per = clk;
 	}
@@ -1078,6 +1078,9 @@ out_put:
 	of_node_put(fpi->phy_node);
 	if (fpi->clk_per)
 		clk_disable_unprepare(fpi->clk_per);
+out_deregister_fixed_link:
+	if (of_phy_is_fixed_link(ofdev->dev.of_node))
+		of_phy_deregister_fixed_link(ofdev->dev.of_node);
 out_free_fpi:
 	kfree(fpi);
 	return ret;
@@ -1096,6 +1099,8 @@ static int fs_enet_remove(struct platfor
 	of_node_put(fep->fpi->phy_node);
 	if (fep->fpi->clk_per)
 		clk_disable_unprepare(fep->fpi->clk_per);
+	if (of_phy_is_fixed_link(ofdev->dev.of_node))
+		of_phy_deregister_fixed_link(ofdev->dev.of_node);
 	free_netdev(ndev);
 	return 0;
 }


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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux