From: Dejin Zheng <zhengdejin5@gmail.com>
To: davem@davemloft.net, jes@trained-monkey.org,
linux-acenic@sunsite.dk, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Dejin Zheng <zhengdejin5@gmail.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: [PATCH net v1] net: acenic: fix an issue about leak related system resources
Date: Sat, 25 Apr 2020 21:40:07 +0800 [thread overview]
Message-ID: <20200425134007.15843-1-zhengdejin5@gmail.com> (raw)
the function ace_allocate_descriptors() and ace_init() can fail in
the acenic_probe_one(), The related system resources were not
released then. so change the error handling to fix it.
Fixes: 1da177e4c3f41524e8 ("Linux-2.6.12-rc2")
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---
drivers/net/ethernet/alteon/acenic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index 5d192d551623..32f9e68dd323 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -568,7 +568,7 @@ static int acenic_probe_one(struct pci_dev *pdev,
#endif
if (ace_allocate_descriptors(dev))
- goto fail_free_netdev;
+ goto fail_uninit;
#ifdef MODULE
if (boards_found >= ACE_MAX_MOD_PARMS)
@@ -580,7 +580,7 @@ static int acenic_probe_one(struct pci_dev *pdev,
#endif
if (ace_init(dev))
- goto fail_free_netdev;
+ goto fail_uninit;
if (register_netdev(dev)) {
printk(KERN_ERR "acenic: device registration failed\n");
--
2.25.0
next reply other threads:[~2020-04-25 13:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-25 13:40 Dejin Zheng [this message]
2020-04-27 10:40 ` [PATCH net v1] net: acenic: fix an issue about leak related system resources Andy Shevchenko
2020-04-28 3:12 ` Dejin Zheng
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=20200425134007.15843-1-zhengdejin5@gmail.com \
--to=zhengdejin5@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=davem@davemloft.net \
--cc=jes@trained-monkey.org \
--cc=linux-acenic@sunsite.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).