From a65c87d2808e2ba8262f97fb36c33b5c0e33d037 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 29 May 2020 11:34:52 +0200 Subject: [PATCH] 4.14-stable patches added patches: net-mlx4_core-fix-a-memory-leak-bug.patch net-sun-fix-missing-release-regions-in-cas_init_one.patch --- .../net-mlx4_core-fix-a-memory-leak-bug.patch | 34 ++++++++++++++ ...sing-release-regions-in-cas_init_one.patch | 45 +++++++++++++++++++ queue-4.14/series | 2 + 3 files changed, 81 insertions(+) create mode 100644 queue-4.14/net-mlx4_core-fix-a-memory-leak-bug.patch create mode 100644 queue-4.14/net-sun-fix-missing-release-regions-in-cas_init_one.patch diff --git a/queue-4.14/net-mlx4_core-fix-a-memory-leak-bug.patch b/queue-4.14/net-mlx4_core-fix-a-memory-leak-bug.patch new file mode 100644 index 00000000000..f8a1abd309b --- /dev/null +++ b/queue-4.14/net-mlx4_core-fix-a-memory-leak-bug.patch @@ -0,0 +1,34 @@ +From febfd9d3c7f74063e8e630b15413ca91b567f963 Mon Sep 17 00:00:00 2001 +From: Qiushi Wu +Date: Fri, 22 May 2020 14:07:15 -0500 +Subject: net/mlx4_core: fix a memory leak bug. + +From: Qiushi Wu + +commit febfd9d3c7f74063e8e630b15413ca91b567f963 upstream. + +In function mlx4_opreq_action(), pointer "mailbox" is not released, +when mlx4_cmd_box() return and error, causing a memory leak bug. +Fix this issue by going to "out" label, mlx4_free_cmd_mailbox() can +free this pointer. + +Fixes: fe6f700d6cbb ("net/mlx4_core: Respond to operation request by firmware") +Signed-off-by: Qiushi Wu +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/mellanox/mlx4/fw.c ++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c +@@ -2715,7 +2715,7 @@ void mlx4_opreq_action(struct work_struc + if (err) { + mlx4_err(dev, "Failed to retrieve required operation: %d\n", + err); +- return; ++ goto out; + } + MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET); + MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET); diff --git a/queue-4.14/net-sun-fix-missing-release-regions-in-cas_init_one.patch b/queue-4.14/net-sun-fix-missing-release-regions-in-cas_init_one.patch new file mode 100644 index 00000000000..67bc928b88d --- /dev/null +++ b/queue-4.14/net-sun-fix-missing-release-regions-in-cas_init_one.patch @@ -0,0 +1,45 @@ +From 5a730153984dd13f82ffae93d7170d76eba204e9 Mon Sep 17 00:00:00 2001 +From: Qiushi Wu +Date: Fri, 22 May 2020 16:50:27 -0500 +Subject: net: sun: fix missing release regions in cas_init_one(). +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Qiushi Wu + +commit 5a730153984dd13f82ffae93d7170d76eba204e9 upstream. + +In cas_init_one(), "pdev" is requested by "pci_request_regions", but it +was not released after a call of the function “pci_write_config_byte” +failed. Thus replace the jump target “err_write_cacheline” by +"err_out_free_res". + +Fixes: 1f26dac32057 ("[NET]: Add Sun Cassini driver.") +Signed-off-by: Qiushi Wu +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/sun/cassini.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/net/ethernet/sun/cassini.c ++++ b/drivers/net/ethernet/sun/cassini.c +@@ -4983,7 +4983,7 @@ static int cas_init_one(struct pci_dev * + cas_cacheline_size)) { + dev_err(&pdev->dev, "Could not set PCI cache " + "line size\n"); +- goto err_write_cacheline; ++ goto err_out_free_res; + } + } + #endif +@@ -5158,7 +5158,6 @@ err_out_iounmap: + err_out_free_res: + pci_release_regions(pdev); + +-err_write_cacheline: + /* Try to restore it in case the error occurred after we + * set it. + */ diff --git a/queue-4.14/series b/queue-4.14/series index 75514cdfc62..7b54ed5a204 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -7,3 +7,5 @@ r8152-support-additional-microsoft-surface-ethernet-adapter-variant.patch sctp-start-shutdown-on-association-restart-if-in-shutdown-sent-state-and-socket-is-closed.patch net-mlx5e-update-netdev-txq-on-completions-during-closure.patch net-qrtr-fix-passing-invalid-reference-to-qrtr_local_enqueue.patch +net-sun-fix-missing-release-regions-in-cas_init_one.patch +net-mlx4_core-fix-a-memory-leak-bug.patch -- 2.47.3