diff mbox series

[v4,7/9] ethdev: fix memory leak when telemetry xstats

Message ID 20220513025357.52275-8-fengchengwen@huawei.com (mailing list archive)
State Accepted
Delegated to: Andrew Rybchenko
Headers show
Series bugfix for ethdev telemetry | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

fengchengwen May 13, 2022, 2:53 a.m. UTC
The 'eth_xstats' should be freed after setup telemetry dictionary. This
patch fixes it.

Fixes: c190daedb9b1 ("ethdev: add telemetry callbacks")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
 lib/ethdev/rte_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 78192c26f7..1ae686a7aa 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -5580,6 +5580,7 @@  eth_dev_handle_port_xstats(const char *cmd __rte_unused,
 	for (i = 0; i < num_xstats; i++)
 		rte_tel_data_add_dict_u64(d, xstat_names[i].name,
 				eth_xstats[i].value);
+	free(eth_xstats);
 	return 0;
 }