Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-06-10 15:08:25 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-06-10 15:10:34 +0200
commit5dd1a878bd198d39694a679abedb1cdda418a35c (patch)
tree45d770ba41e51ab47cf33c76aeaeb95b88afeea6
parentea98f5762a1052208493bfd0ca1b2e51e452c385 (diff)
ibmvnic: Fix unchecked return codes of memory allocations
(bsc#1137752).
-rw-r--r--patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch55
-rw-r--r--series.conf1
2 files changed, 56 insertions, 0 deletions
diff --git a/patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch b/patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch
new file mode 100644
index 0000000000..f730273849
--- /dev/null
+++ b/patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch
@@ -0,0 +1,55 @@
+From 7c940b1a5291e5069d561f5b8f0e51db6b7a259a Mon Sep 17 00:00:00 2001
+From: Thomas Falcon <tlfalcon@linux.ibm.com>
+Date: Fri, 7 Jun 2019 16:03:55 -0500
+Subject: [PATCH] ibmvnic: Fix unchecked return codes of memory allocations
+
+References: bsc#1137752
+Patch-mainline: queued
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
+Git-commit: 7c940b1a5291e5069d561f5b8f0e51db6b7a259a
+
+The return values for these memory allocations are unchecked,
+which may cause an oops if the driver does not handle them after
+a failure. Fix by checking the function's return code.
+
+Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ drivers/net/ethernet/ibm/ibmvnic.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
+index 9e9f4096db58..3da680073265 100644
+--- a/drivers/net/ethernet/ibm/ibmvnic.c
++++ b/drivers/net/ethernet/ibm/ibmvnic.c
+@@ -428,9 +428,10 @@ static int reset_rx_pools(struct ibmvnic_adapter *adapter)
+ if (rx_pool->buff_size != be64_to_cpu(size_array[i])) {
+ free_long_term_buff(adapter, &rx_pool->long_term_buff);
+ rx_pool->buff_size = be64_to_cpu(size_array[i]);
+- alloc_long_term_buff(adapter, &rx_pool->long_term_buff,
+- rx_pool->size *
+- rx_pool->buff_size);
++ rc = alloc_long_term_buff(adapter,
++ &rx_pool->long_term_buff,
++ rx_pool->size *
++ rx_pool->buff_size);
+ } else {
+ rc = reset_long_term_buff(adapter,
+ &rx_pool->long_term_buff);
+@@ -696,9 +697,9 @@ static int init_tx_pools(struct net_device *netdev)
+ return rc;
+ }
+
+- init_one_tx_pool(netdev, &adapter->tso_pool[i],
+- IBMVNIC_TSO_BUFS,
+- IBMVNIC_TSO_BUF_SZ);
++ rc = init_one_tx_pool(netdev, &adapter->tso_pool[i],
++ IBMVNIC_TSO_BUFS,
++ IBMVNIC_TSO_BUF_SZ);
+ if (rc) {
+ release_tx_pools(adapter);
+ return rc;
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 574ee01361..20f5ffe05f 100644
--- a/series.conf
+++ b/series.conf
@@ -22303,6 +22303,7 @@
# davem/net
patches.drivers/ibmvnic-Do-not-close-unopened-driver-during-reset.patch
patches.drivers/ibmvnic-Refresh-device-multicast-list-after-reset.patch
+ patches.drivers/ibmvnic-Fix-unchecked-return-codes-of-memory-allocat.patch
# dhowells/linux-fs keys-uefi
patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch