From: Greg Kroah-Hartman Date: Fri, 29 May 2020 09:34:38 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.4.226~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d86a8744778723323209ecb5f576015abe0e38bc;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: net-mlx4_core-fix-a-memory-leak-bug.patch net-sun-fix-missing-release-regions-in-cas_init_one.patch --- diff --git a/queue-4.9/net-mlx4_core-fix-a-memory-leak-bug.patch b/queue-4.9/net-mlx4_core-fix-a-memory-leak-bug.patch new file mode 100644 index 00000000000..a07e4dac231 --- /dev/null +++ b/queue-4.9/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 +@@ -2704,7 +2704,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.9/net-sun-fix-missing-release-regions-in-cas_init_one.patch b/queue-4.9/net-sun-fix-missing-release-regions-in-cas_init_one.patch new file mode 100644 index 00000000000..8e550b5688a --- /dev/null +++ b/queue-4.9/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 +@@ -4980,7 +4980,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 +@@ -5151,7 +5151,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.9/series b/queue-4.9/series index 01d9f6b28ca..c54ccf610f8 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -6,3 +6,5 @@ sctp-start-shutdown-on-association-restart-if-in-shutdown-sent-state-and-socket- net-mlx5e-update-netdev-txq-on-completions-during-closure.patch net-qrtr-fix-passing-invalid-reference-to-qrtr_local_enqueue.patch net-mlx5-add-command-entry-handling-completion.patch +net-sun-fix-missing-release-regions-in-cas_init_one.patch +net-mlx4_core-fix-a-memory-leak-bug.patch