e1000: fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Mon, 12 Aug 2019 05:59:21 +0000 (00:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2019 18:16:07 +0000 (19:16 +0100)
commit18372c98cf9ebc696ac6ccef904592ab30fc2d3d
treefa240f07ac08599db3686ebb21dc64bc2a42f10a
parentd0844089e3e2ae95865e8526b4f48d9acdeb72b7
e1000: fix memory leaks

[ Upstream commit 8472ba62154058b64ebb83d5f57259a352d28697 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/e1000/e1000_ethtool.c