app/compress-perf: fix memory deallocation issue
PATCH 1/1 app/compress-perf: fix memory deallocation issue
This patch fixes the memory deallocation issue which happened after unsuccessful allocation (e.g. due to the out of memory) and produced the segmentation fault.
Fixes 424dd6c8c1 ("app/compress-perf: add weak functions for multicore test")
Signed-off-by Adam Dybkowski <[email protected]>
--- app/test-compress-perf/comp_perf_test_common.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
app/test-compress-perf/comp_perf_test_common.c +7 -4
@@ -81,10 +81,13 @@ comp_perf_free_memory(struct cperf_mem_resources *mem) {uint32_t i; -for (i =0 ; i < mem->total_bufs; i++) { -rte_pktmbuf_free (mem->comp_bufs[i]); -rte_pktmbuf_free (mem->decomp_bufs[i]); - } +if (mem->decomp_bufs !=NULL ) +for (i =0 ; i < mem->total_bufs; i++) +rte_pktmbuf_free (mem->decomp_bufs[i]); + +if (mem->comp_bufs !=NULL ) +for (i =0 ; i < mem->total_bufs; i++) +rte_pktmbuf_free (mem->comp_bufs[i]);rte_free (mem->decomp_bufs);rte_free (mem->comp_bufs);
Signature · 1 line
2.17.1
This patch fixes the memory deallocation issue which happened after unsuccessful allocation (e.g. due to the out of memory) and produced the segmentation fault.
Fixes 424dd6c8c1 ("app/compress-perf: add weak functions for multicore test")
Signed-off-by Adam Dybkowski <[email protected]>
Acked-by Artur Trybula <[email protected]>
---
Akhil Goyal
AppliedQuoted 10 lines
This patch fixes the memory deallocation issue which happened after unsuccessful allocation (e.g. due to the out of memory) and produced the segmentation fault.
Fixes 424dd6c8c1 ("app/compress-perf: add weak functions for multicoretest")
Signed-off-by Adam Dybkowski <[email protected]>---
Applied to dpdk-next-crypto
Thanks.