patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] net/ice: fix FDIR counter resource release
@ 2019-11-05  2:09 Wang ShougangX
  0 siblings, 0 replies; only message in thread
From: Wang ShougangX @ 2019-11-05  2:09 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, yahui.cao, Wang ShougangX, stable

To avoid memory leak, all the counter resources should be
released when teardown.

Fixes: 0f880c3df192 ("net/ice: add flow director counter resource init/release")
Cc: stable@dpdk.org

Signed-off-by: Wang ShougangX <shougangx.wang@intel.com>
---
 drivers/net/ice/ice_fdir_filter.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 736ccd54e..4a4349824 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -256,8 +256,13 @@ ice_fdir_counter_release(struct ice_pf *pf)
 				&fdir_info->counter;
 	uint8_t i;
 
-	for (i = 0; i < container->index_free; i++)
+	for (i = 0; i < container->index_free; i++) {
 		rte_free(container->pools[i]);
+		container->pools[i] = NULL;
+	}
+
+	TAILQ_INIT(&container->pool_list);
+	container->index_free = 0;
 
 	return 0;
 }
-- 
2.17.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05  2:09 [dpdk-stable] [PATCH] net/ice: fix FDIR counter resource release Wang ShougangX

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox