[PATCH v3] app/proc-info: add rte_eal_cleanup() to avoid memory leak
Stephen Hemminger
stephen at networkplumber.org
Fri Oct 4 04:48:29 CEST 2024
From: Fidaullah Noonari <fidaullah.noonari at emumba.com>
when app is launched with -m proc-info exit without
rte_eal_cleanup() causing memory leakage. This commit resolves the
memory leakage issue and closes app properly.
Bugzilla id: 898
Signed-off-by: Fidaullah Noonari <fidaullah.noonari at emumba.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
v3 - handle eventdev_xstats as well
rebase to 24.11
app/proc-info/main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index b672aaefbe..4a558705cc 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -2166,11 +2166,11 @@ main(int argc, char **argv)
if (mem_info) {
meminfo_display();
- return 0;
+ goto cleanup;
}
if (eventdev_xstats() > 0)
- return 0;
+ goto cleanup;
nb_ports = rte_eth_dev_count_avail();
if (nb_ports == 0)
@@ -2251,6 +2251,7 @@ main(int argc, char **argv)
RTE_ETH_FOREACH_DEV(i)
rte_eth_dev_close(i);
+cleanup:
ret = rte_eal_cleanup();
if (ret)
printf("Error from rte_eal_cleanup(), %d\n", ret);
--
2.45.2
More information about the dev
mailing list