Skip to content

Commit

Permalink
[PATCH] e1000: avoid leak when e1000_setup_loopback_test fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John W. Linville committed Nov 18, 2005
1 parent cd52d1e commit e98fc4a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/e1000/e1000_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e98fc4a

Please sign in to comment.