Patch "net: phy: xgene: disable clk on error paths" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
net: phy: xgene: disable clk on error paths
to the 4.9-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-phy-xgene-disable-clk-on-error-paths.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Wed Feb 28 16:13:29 CET 2018
From: Alexey Khoroshilov <[email protected]>
Date: Sat, 16 Dec 2017 00:52:39 +0300
Subject: net: phy: xgene: disable clk on error paths
From: Alexey Khoroshilov <[email protected]>
[ Upstream commit ab14436065c8066c265540312742390d6d07ddd2 ]
There are several error paths in xgene_mdio_probe(), where clk is left undisabled. The patch fixes them.
Found by Linux Driver Verification project (linuxtesting.org).
--- drivers/net/phy/mdio-xgene.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/net/phy/mdio-xgene.c +15 -6
@@ -197,8 +197,11 @@ static int xgene_mdio_reset(struct xgene } ret =xgene_enet_ecc_init (pdata); -if (ret) +if (ret) { +if (pdata->dev->of_node) +clk_disable_unprepare (pdata->clk);return ret; + }xgene_gmac_reset (pdata);return 0 ;
@@ -364,8 +367,10 @@ static int xgene_mdio_probe(struct platfreturn ret; mdio_bus =mdiobus_alloc (); -if (!mdio_bus) -return -ENOMEM ; +if (!mdio_bus) { + ret = -ENOMEM ; + goto out_clk; + } mdio_bus->name ="APM X-Gene MDIO bus" ;
@@ -394,7 +399,7 @@ static int xgene_mdio_probe(struct platf mdio_bus->phy_mask = ~0 ; ret =mdiobus_register (mdio_bus);if (ret) - goto out; + goto out_mdiobus;acpi_walk_namespace (ACPI_TYPE_DEVICE ,ACPI_HANDLE (dev),1 , acpi_register_phy,NULL , mdio_bus,NULL );
@@ -402,16 +407,20 @@ static int xgene_mdio_probe(struct platf }if (ret) - goto out; + goto out_mdiobus; pdata->mdio_bus = mdio_bus; xgene_mdio_status = true;return 0 ; -out: +out_mdiobus:mdiobus_free (mdio_bus); +out_clk: +if (dev->of_node) +clk_disable_unprepare (pdata->clk); +return ret; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/net-phy-xgene-disable-clk-on-error-paths.patch