summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale/fec_main.c
diff options
context:
space:
mode:
authorFugang Duan <fugang.duan@nxp.com>2018-01-04 10:47:20 +0800
committerDavid S. Miller <davem@davemloft.net>2018-01-05 11:19:11 -0500
commitd1616f07e8f1a4a490d1791316d4a68906b284aa (patch)
tree014c629a46f8cdf4cd4a8fbd702fd56494d3efc6 /drivers/net/ethernet/freescale/fec_main.c
parentf737be8d61f251d2c1632f871ba824aa5a512384 (diff)
downloadlinux-d1616f07e8f1a4a490d1791316d4a68906b284aa.tar.gz
linux-d1616f07e8f1a4a490d1791316d4a68906b284aa.tar.bz2
linux-d1616f07e8f1a4a490d1791316d4a68906b284aa.zip
net: fec: free/restore resource in related probe error pathes
Fixes in probe error path: - Restore dev_id before failed_ioremap path. Fixes: ("net: fec: restore dev_id in the cases of probe error") - Call of_node_put(phy_node) before failed_phy path. Fixes: ("net: fec: Support phys probed from devicetree and fixed-link") Signed-off-by: Fugang Duan <fugang.duan@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/fec_main.c')
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 19f198e22e15..a74300a4459c 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3556,11 +3556,11 @@ failed_clk_ipg:
failed_clk:
if (of_phy_is_fixed_link(np))
of_phy_deregister_fixed_link(np);
-failed_phy:
of_node_put(phy_node);
+failed_phy:
+ dev_id--;
failed_ioremap:
free_netdev(ndev);
- dev_id--;
return ret;
}