From: Fugang Duan <fugang.duan@nxp.com>
To: <troy.kisky@boundarydevices.com>, <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <festevam@gmail.com>, <fugang.duan@nxp.com>
Subject: [PATCH net,stable 1/1] net: fec: free/restore resource in related probe error pathes
Date: Thu, 4 Jan 2018 10:47:20 +0800 [thread overview]
Message-ID: <1515034040-12482-1-git-send-email-fugang.duan@nxp.com> (raw)
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>
---
drivers/net/ethernet/freescale/fec_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index feed383..90aa69a 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3576,11 +3576,11 @@ static int fec_enet_get_irq_cnt(struct platform_device *pdev)
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;
}
--
1.9.1
next reply other threads:[~2018-01-04 2:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-04 2:47 Fugang Duan [this message]
2018-01-05 16:20 ` [PATCH net,stable 1/1] net: fec: free/restore resource in related probe error pathes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1515034040-12482-1-git-send-email-fugang.duan@nxp.com \
--to=fugang.duan@nxp.com \
--cc=davem@davemloft.net \
--cc=festevam@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=troy.kisky@boundarydevices.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox