Commit d1616f07 authored by Fugang Duan's avatar Fugang Duan Committed by David S. Miller

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: default avatarFugang Duan <fugang.duan@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f737be8d
...@@ -3556,11 +3556,11 @@ fec_probe(struct platform_device *pdev) ...@@ -3556,11 +3556,11 @@ fec_probe(struct platform_device *pdev)
failed_clk: failed_clk:
if (of_phy_is_fixed_link(np)) if (of_phy_is_fixed_link(np))
of_phy_deregister_fixed_link(np); of_phy_deregister_fixed_link(np);
failed_phy:
of_node_put(phy_node); of_node_put(phy_node);
failed_phy:
dev_id--;
failed_ioremap: failed_ioremap:
free_netdev(ndev); free_netdev(ndev);
dev_id--;
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment