e1000: ensure to free old tx/rx rings in set_ringparam()
authorBo Chen <chenbo@pdx.edu>
Mon, 23 Jul 2018 16:01:30 +0000 (09:01 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 24 Aug 2018 15:52:35 +0000 (08:52 -0700)
commitee400a3f1bfe7004a3e14b81c38ccc5583c26295
tree8357d0a9b5e1580404292997940d113ae31a4624
parentcf1acec008f8d7761aa3fd7c4bca7e17b2d2512d
e1000: ensure to free old tx/rx rings in set_ringparam()

In 'e1000_set_ringparam()', the tx_ring and rx_ring are updated with new value
and the old tx/rx rings are freed only when the device is up. There are resource
leaks on old tx/rx rings when the device is not up. This bug is reported by COD,
a tool for testing kernel module binaries I am building.

This patch fixes the bug by always calling 'kfree()' on old tx/rx rings in
'e1000_set_ringparam()'.

Signed-off-by: Bo Chen <chenbo@pdx.edu>
Reviewed-by: Alexander Duyck <alexander.h.duyck@intel.com>
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