[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200425134007.15843-1-zhengdejin5@gmail.com>
Date: Sat, 25 Apr 2020 21:40:07 +0800
From: Dejin Zheng <zhengdejin5@...il.com>
To: davem@...emloft.net, jes@...ined-monkey.org,
linux-acenic@...site.dk, netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Dejin Zheng <zhengdejin5@...il.com>,
Andy Shevchenko <andy.shevchenko@...il.com>
Subject: [PATCH net v1] net: acenic: fix an issue about leak related system resources
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@...il.com>
Signed-off-by: Dejin Zheng <zhengdejin5@...il.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
Powered by blists - more mailing lists