[dpdk-dev] [PATCH v2 3/3] test/hash: free allocated memory

Honnappa Nagarahalli honnappa.nagarahalli at arm.com
Fri Jun 28 06:52:54 CEST 2019


Free allocated memory.

Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket")
Cc: stable at dpdk.org

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar at arm.com>
---
 app/test/test_hash_readwrite_lf.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/app/test/test_hash_readwrite_lf.c b/app/test/test_hash_readwrite_lf.c
index 12522e265..9b054dec0 100644
--- a/app/test/test_hash_readwrite_lf.c
+++ b/app/test/test_hash_readwrite_lf.c
@@ -537,6 +537,7 @@ generate_keys(void)
 	       tbl_rwc_test_param.count_keys_ks_extbkt);
 
 	rte_free(found);
+	rte_free(scanned_bkts);
 	rte_hash_free(tbl_rwc_test_param.h);
 	return 0;
 
@@ -547,9 +548,11 @@ generate_keys(void)
 	rte_free(keys_absent);
 	rte_free(found);
 	rte_free(tbl_rwc_test_param.keys_shift_path);
+	rte_free(keys_non_shift_path);
 	rte_free(keys_ext_bkt);
 	rte_free(keys_ks_extbkt);
 	rte_free(scanned_bkts);
+	rte_hash_free(tbl_rwc_test_param.h);
 	return -1;
 }
 
@@ -653,6 +656,8 @@ test_rwc_reader(__attribute__((unused)) void *arg)
 	cycles = rte_rdtsc_precise() - begin;
 	rte_atomic64_add(&gread_cycles, cycles);
 	rte_atomic64_add(&greads, read_cnt*loop_cnt);
+
+	rte_free(pos);
 	return 0;
 }
 
@@ -1431,7 +1436,9 @@ test_hash_readwrite_lf_main(void)
 	rte_free(tbl_rwc_test_param.keys_ks);
 	rte_free(tbl_rwc_test_param.keys_absent);
 	rte_free(tbl_rwc_test_param.keys_shift_path);
-	rte_free(scanned_bkts);
+	rte_free(tbl_rwc_test_param.keys_non_shift_path);
+	rte_free(tbl_rwc_test_param.keys_ext_bkt);
+	rte_free(tbl_rwc_test_param.keys_ks_extbkt);
 	return 0;
 }
 
-- 
2.17.1



More information about the dev mailing list