[dpdk-stable] patch 'net/fm10k: fix memory leak when 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:03 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 3b77cd741f5dfd61738cafa0dabf8adf5586270e Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Mon, 28 Sep 2020 20:44:42 +0800
Subject: [PATCH] net/fm10k: fix memory leak when thresh check fails

[ upstream commit c87a6de2a130c436fcf73b27f829c48e8249bcc4 ]

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

Fixes: 6cfe8969c969 ("fm10k: add Rx queue setup/release")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Acked-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index a65865c683..5ce59be7d5 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1854,9 +1854,10 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
 	q->tail_ptr = (volatile uint32_t *)
 		&((uint32_t *)hw->hw_addr)[FM10K_RDT(queue_id)];
 	q->offloads = offloads;
-	if (handle_rxconf(q, conf))
+	if (handle_rxconf(q, conf)) {
+		rte_free(q);
 		return -EINVAL;
-
+	}
 	/* allocate memory for the software ring */
 	q->sw_ring = rte_zmalloc_socket("fm10k sw ring",
 			(nb_desc + q->nb_fake_desc) * sizeof(struct rte_mbuf *),
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:14.378618201 +0000
+++ 0084-net-fm10k-fix-memory-leak-when-thresh-check-fails.patch	2020-10-28 10:35:11.604831496 +0000
@@ -1,13 +1,14 @@
-From c87a6de2a130c436fcf73b27f829c48e8249bcc4 Mon Sep 17 00:00:00 2001
+From 3b77cd741f5dfd61738cafa0dabf8adf5586270e Mon Sep 17 00:00:00 2001
 From: Yunjian Wang <wangyunjian at huawei.com>
 Date: Mon, 28 Sep 2020 20:44:42 +0800
 Subject: [PATCH] net/fm10k: fix memory leak when thresh check fails
 
+[ upstream commit c87a6de2a130c436fcf73b27f829c48e8249bcc4 ]
+
 In fm10k_rx_queue_setup(), we allocate memory for the queue
 structure but not released when thresh check fails.
 
 Fixes: 6cfe8969c969 ("fm10k: add Rx queue setup/release")
-Cc: stable at dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
 Acked-by: Qi Zhang <qi.z.zhang at intel.com>
@@ -16,10 +17,10 @@
  1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
-index 5771d83b55..98e396b8e7 100644
+index a65865c683..5ce59be7d5 100644
 --- a/drivers/net/fm10k/fm10k_ethdev.c
 +++ b/drivers/net/fm10k/fm10k_ethdev.c
-@@ -1841,9 +1841,10 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
+@@ -1854,9 +1854,10 @@ fm10k_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_id,
  	q->tail_ptr = (volatile uint32_t *)
  		&((uint32_t *)hw->hw_addr)[FM10K_RDT(queue_id)];
  	q->offloads = offloads;


More information about the stable mailing list