Skip to content

Commit

Permalink
ethdev: fix memory leak in xstats telemetry
Browse files Browse the repository at this point in the history
[ upstream commit 2d00e2b ]

The 'eth_xstats' should be freed after telemetry dictionary setup.

Fixes: c190dae ("ethdev: add telemetry callbacks")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  • Loading branch information
fengchengwen authored and kevintraynor committed Jun 8, 2022
1 parent b6a52d1 commit b132a5c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/ethdev/rte_ethdev.c
Expand Up @@ -6275,6 +6275,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;
}

Expand Down

0 comments on commit b132a5c

Please sign in to comment.