Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:08:48 +0100
committerThomas Bogendoerfer <tbogendoerfer@suse.de>2019-11-05 14:09:59 +0100
commita3809eface9b801b18e5031f2e1f53cdfb1cfb25 (patch)
treeaec274e1a6f2ac1db8f6da5f87acff4cfb525f4f
parentb6ef0b30d4eed25b2242019bf5171ad6a4b2de1b (diff)
e1000: fix memory leaks (jsc#SLE-8100).
-rw-r--r--patches.suse/e1000-fix-memory-leaks.patch54
-rw-r--r--series.conf1
2 files changed, 55 insertions, 0 deletions
diff --git a/patches.suse/e1000-fix-memory-leaks.patch b/patches.suse/e1000-fix-memory-leaks.patch
new file mode 100644
index 0000000000..56a12388aa
--- /dev/null
+++ b/patches.suse/e1000-fix-memory-leaks.patch
@@ -0,0 +1,54 @@
+From: Wenwen Wang <wenwen@cs.uga.edu>
+Date: Mon, 12 Aug 2019 00:59:21 -0500
+Subject: e1000: fix memory leaks
+Patch-mainline: v5.4-rc6
+Git-commit: 8472ba62154058b64ebb83d5f57259a352d28697
+References: jsc#SLE-8100
+
+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>
+Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+---
+ drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
++++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
+@@ -607,6 +607,7 @@ static int e1000_set_ringparam(struct ne
+ for (i = 0; i < adapter->num_rx_queues; i++)
+ rxdr[i].count = rxdr->count;
+
++ err = 0;
+ if (netif_running(adapter->netdev)) {
+ /* Try to get new resources before deleting old */
+ err = e1000_setup_all_rx_resources(adapter);
+@@ -627,14 +628,13 @@ static int e1000_set_ringparam(struct ne
+ adapter->rx_ring = rxdr;
+ adapter->tx_ring = txdr;
+ err = e1000_up(adapter);
+- if (err)
+- goto err_setup;
+ }
+ kfree(tx_old);
+ kfree(rx_old);
+
+ clear_bit(__E1000_RESETTING, &adapter->flags);
+- return 0;
++ return err;
++
+ err_setup_tx:
+ e1000_free_all_rx_resources(adapter);
+ err_setup_rx:
+@@ -646,7 +646,6 @@ err_alloc_rx:
+ err_alloc_tx:
+ if (netif_running(adapter->netdev))
+ e1000_up(adapter);
+-err_setup:
+ clear_bit(__E1000_RESETTING, &adapter->flags);
+ return err;
+ }
diff --git a/series.conf b/series.conf
index d3468ebdbc..becf0a163b 100644
--- a/series.conf
+++ b/series.conf
@@ -2894,6 +2894,7 @@
patches.suse/igb-Enable-media-autosense-for-the-i350.patch
patches.suse/igb-Fix-constant-media-auto-sense-switching-when-no-.patch
patches.suse/i40e-Fix-receive-buffer-starvation-for-AF_XDP.patch
+ patches.suse/e1000-fix-memory-leaks.patch
patches.suse/powerpc-powernv-Fix-CPU-idle-to-be-called-with-IRQs-.patch
patches.suse/scsi-qla2xxx-fixup-incorrect-usage-of-host_byte.patch
patches.suse/scsi-lpfc-Check-queue-pointer-before-use.patch