test/mempool: free mempool on exit
authorShreyansh Jain <shreyansh.jain@nxp.com>
Wed, 5 Apr 2017 09:35:33 +0000 (15:05 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 19 Apr 2017 13:41:15 +0000 (15:41 +0200)
mempool autotest was not freeing the mempools.

Fixes: 8ef772ae ("app/test: rework mempool test")
Cc: stable@dpdk.org
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
test/test/test_mempool.c

index b9880b3..715b250 100644 (file)
@@ -509,6 +509,7 @@ walk_cb(struct rte_mempool *mp, void *userdata __rte_unused)
 static int
 test_mempool(void)
 {
+       int ret = -1;
        struct rte_mempool *mp_cache = NULL;
        struct rte_mempool *mp_nocache = NULL;
        struct rte_mempool *mp_stack = NULL;
@@ -607,13 +608,13 @@ test_mempool(void)
 
        rte_mempool_list_dump(stdout);
 
-       return 0;
+       ret = 0;
 
 err:
        rte_mempool_free(mp_nocache);
        rte_mempool_free(mp_cache);
        rte_mempool_free(mp_stack);
-       return -1;
+       return ret;
 }
 
 REGISTER_TEST_COMMAND(mempool_autotest, test_mempool);