All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] event/opdl: fix the resource leak issue
@ 2018-01-24 15:05 Liang Ma
  2018-01-24 15:05 ` [PATCH 2/2] event/opdl: fix dereference before null check Liang Ma
  2018-01-31  9:43 ` [PATCH 1/2] event/opdl: fix the resource leak issue Jerin Jacob
  0 siblings, 2 replies; 3+ messages in thread
From: Liang Ma @ 2018-01-24 15:05 UTC (permalink / raw)
  To: dev; +Cc: harry.van.haaren, bruce.richardson, peter.mccarthy, jerin.jacob

Fixes: d548ef513cd7 ("event/opdl: add unit tests")
Coverity issue: 257004

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
---
 drivers/event/opdl/opdl_test.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/event/opdl/opdl_test.c b/drivers/event/opdl/opdl_test.c
index 44a5cc5..4894c08 100644
--- a/drivers/event/opdl/opdl_test.c
+++ b/drivers/event/opdl/opdl_test.c
@@ -1002,11 +1002,13 @@ opdl_selftest(void)
 		/* turn on stats by default */
 		if (rte_vdev_init(eventdev_name, "do_validation=1") < 0) {
 			PMD_DRV_LOG(ERR, "Error creating eventdev\n");
+			free(t);
 			return -1;
 		}
 		evdev = rte_event_dev_get_dev_id(eventdev_name);
 		if (evdev < 0) {
 			PMD_DRV_LOG(ERR, "Error finding newly created eventdev\n");
+			free(t);
 			return -1;
 		}
 	}
@@ -1022,6 +1024,7 @@ opdl_selftest(void)
 				rte_socket_id());
 		if (!eventdev_func_mempool) {
 			PMD_DRV_LOG(ERR, "ERROR creating mempool\n");
+			free(t);
 			return -1;
 		}
 	}
@@ -1044,9 +1047,9 @@ opdl_selftest(void)
 	ret = single_link_w_stats(t);
 
 	/*
-	 * Free test instance, leaving mempool initialized, and a pointer to it
-	 * in static eventdev_func_mempool, as it is re-used on re-runs
+	 * Free test instance, free  mempool
 	 */
+	rte_mempool_free(t->mbuf_pool);
 	free(t);
 
 	if (ret != 0)
-- 
2.7.5

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

end of thread, other threads:[~2018-01-31  9:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24 15:05 [PATCH 1/2] event/opdl: fix the resource leak issue Liang Ma
2018-01-24 15:05 ` [PATCH 2/2] event/opdl: fix dereference before null check Liang Ma
2018-01-31  9:43 ` [PATCH 1/2] event/opdl: fix the resource leak issue Jerin Jacob

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.