DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] app/compress-perf: fix memory deallocation issue
@ 2019-08-06  9:40 Adam Dybkowski
  2019-09-09 14:05 ` Trybula, ArturX
  2019-09-19 14:51 ` Akhil Goyal
  0 siblings, 2 replies; 3+ messages in thread
From: Adam Dybkowski @ 2019-08-06  9:40 UTC (permalink / raw)
  To: dev, fiona.trahe, pablo.de.lara.guarch; +Cc: Adam Dybkowski

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 <adamx.dybkowski@intel.com>
---
 app/test-compress-perf/comp_perf_test_common.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c
index 6edc40f04..7b26734c9 100644
--- a/app/test-compress-perf/comp_perf_test_common.c
+++ b/app/test-compress-perf/comp_perf_test_common.c
@@ -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);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/compress-perf: fix memory deallocation issue
  2019-08-06  9:40 [dpdk-dev] [PATCH] app/compress-perf: fix memory deallocation issue Adam Dybkowski
@ 2019-09-09 14:05 ` Trybula, ArturX
  2019-09-19 14:51 ` Akhil Goyal
  1 sibling, 0 replies; 3+ messages in thread
From: Trybula, ArturX @ 2019-09-09 14:05 UTC (permalink / raw)
  To: dev; +Cc: Dybkowski, AdamX

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 <adamx.dybkowski@intel.com>
Acked-by: Artur Trybula <arturx.trybula@intel.com>
---

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/compress-perf: fix memory deallocation issue
  2019-08-06  9:40 [dpdk-dev] [PATCH] app/compress-perf: fix memory deallocation issue Adam Dybkowski
  2019-09-09 14:05 ` Trybula, ArturX
@ 2019-09-19 14:51 ` Akhil Goyal
  1 sibling, 0 replies; 3+ messages in thread
From: Akhil Goyal @ 2019-09-19 14:51 UTC (permalink / raw)
  To: Adam Dybkowski, dev, fiona.trahe, pablo.de.lara.guarch

> 
> 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 <adamx.dybkowski@intel.com>
> ---
Applied to dpdk-next-crypto

Thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06  9:40 [dpdk-dev] [PATCH] app/compress-perf: fix memory deallocation issue Adam Dybkowski
2019-09-09 14:05 ` Trybula, ArturX
2019-09-19 14:51 ` Akhil Goyal

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox