[dpdk-stable] patch 'net/fm10k: fix memory leak when Tx thresh check fails' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:44:48 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 4d88e14ad7f458cc586c838609a893e0b20e5ce9 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Wed, 7 Oct 2020 15:36:46 +0800
Subject: [PATCH] net/fm10k: fix memory leak when Tx thresh check fails

[ upstream commit 9e4f075bc500dafe4568edf99b9a1161b554316e ]

In fm10k_tx_queue_setup(), we allocate memory for the queue
structure but not released when Tx thresh check fails.

Fixes: 98068e0e044e ("fm10k: add Tx queue setup/release")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Xiao Wang <xiao.w.wang at intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 5ce59be7d5..7a83b6f68e 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2037,8 +2037,10 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	q->ops = &def_txq_ops;
 	q->tail_ptr = (volatile uint32_t *)
 		&((uint32_t *)hw->hw_addr)[FM10K_TDT(queue_id)];
-	if (handle_txconf(q, conf))
+	if (handle_txconf(q, conf)) {
+		rte_free(q);
 		return -EINVAL;
+	}
 
 	/* allocate memory for the software ring */
 	q->sw_ring = rte_zmalloc_socket("fm10k sw ring",
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:15.754284907 +0000
+++ 0129-net-fm10k-fix-memory-leak-when-Tx-thresh-check-fails.patch	2020-10-28 10:35:11.700832909 +0000
@@ -1,13 +1,14 @@
-From 9e4f075bc500dafe4568edf99b9a1161b554316e Mon Sep 17 00:00:00 2001
+From 4d88e14ad7f458cc586c838609a893e0b20e5ce9 Mon Sep 17 00:00:00 2001
 From: Yunjian Wang <wangyunjian at huawei.com>
 Date: Wed, 7 Oct 2020 15:36:46 +0800
 Subject: [PATCH] net/fm10k: fix memory leak when Tx thresh check fails
 
+[ upstream commit 9e4f075bc500dafe4568edf99b9a1161b554316e ]
+
 In fm10k_tx_queue_setup(), we allocate memory for the queue
 structure but not released when Tx thresh check fails.
 
 Fixes: 98068e0e044e ("fm10k: add Tx queue setup/release")
-Cc: stable at dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
 Acked-by: Xiao Wang <xiao.w.wang at intel.com>
@@ -16,10 +17,10 @@
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
-index 3096370718..c4a6fdf7f0 100644
+index 5ce59be7d5..7a83b6f68e 100644
 --- a/drivers/net/fm10k/fm10k_ethdev.c
 +++ b/drivers/net/fm10k/fm10k_ethdev.c
-@@ -2024,8 +2024,10 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
+@@ -2037,8 +2037,10 @@ fm10k_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
  	q->ops = &def_txq_ops;
  	q->tail_ptr = (volatile uint32_t *)
  		&((uint32_t *)hw->hw_addr)[FM10K_TDT(queue_id)];


More information about the stable mailing list