summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2005-11-08 21:45:02 +0100
committerJohn W. Linville <linville@tuxdriver.com>2005-11-18 19:52:39 +0100
commite98fc4aae10b925ad5aa739c483abf78d80b66db (patch)
treebb7ff2db2dcf8630e72a4b26b32319d59d0467d7 /drivers/net
parentLinux v2.6.15-rc1 (diff)
downloadlinux-e98fc4aae10b925ad5aa739c483abf78d80b66db.tar.xz
linux-e98fc4aae10b925ad5aa739c483abf78d80b66db.zip
[PATCH] e1000: avoid leak when e1000_setup_loopback_test fails
In e1000_loopback_test, make sure to call e1000_free_desc_rings if e1000_setup_loopback_test fails. Currently in that case it will not get called, causing a leak. Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/e1000/e1000_ethtool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 8eae8ba27e84..8584e9382c2c 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1440,9 +1440,11 @@ static int
e1000_loopback_test(struct e1000_adapter *adapter, uint64_t *data)
{
if((*data = e1000_setup_desc_rings(adapter))) goto err_loopback;
- if((*data = e1000_setup_loopback_test(adapter))) goto err_loopback;
+ if((*data = e1000_setup_loopback_test(adapter)))
+ goto err_loopback_setup;
*data = e1000_run_loopback_test(adapter);
e1000_loopback_cleanup(adapter);
+err_loopback_setup:
e1000_free_desc_rings(adapter);
err_loopback:
return *data;