e1000: fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Mon, 12 Aug 2019 05:59:21 +0000 (00:59 -0500)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 1 Nov 2019 20:20:33 +0000 (13:20 -0700)
commit8472ba62154058b64ebb83d5f57259a352d28697
tree1658da565edf5b754cecc8d52bb7337bae5d4099
parent2c19e395e061a1c1442e0623ce5ec88ecc6c5a9b
e1000: fix memory leaks

In e1000_set_ringparam(), 'tx_old' and 'rx_old' are not deallocated if
e1000_up() fails, leading to memory leaks. Refactor the code to fix this
issue.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e1000/e1000_ethtool.c