From: Fugang Duan Date: Thu, 4 Jan 2018 02:47:20 +0000 (+0800) Subject: net: fec: free/restore resource in related probe error pathes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d48c6464c50ef8e7eac7a04bbd2afcc23f020b21;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git net: fec: free/restore resource in related probe error pathes [ Upstream commit d1616f07e8f1a4a490d1791316d4a68906b284aa ] 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 768f031a27d8..311539c6625f 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3543,11 +3543,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; }