X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fevent%2Fopdl%2Fopdl_test.c;h=e7a32fbd31c24cd8b34b379c62444b4ff0e66f9c;hb=f74904ce98e84f48e8f3a96b7ad6b6347c3f44b6;hp=39c6cf8cf6432f21db86a6ad56c04efe4d8ac025;hpb=8b35ad02dbf9fee21f40c1031f829554705f69f7;p=dpdk.git diff --git a/drivers/event/opdl/opdl_test.c b/drivers/event/opdl/opdl_test.c index 39c6cf8cf6..e7a32fbd31 100644 --- a/drivers/event/opdl/opdl_test.c +++ b/drivers/event/opdl/opdl_test.c @@ -1,6 +1,5 @@ -/*- - * SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2010-2014 Intel Corporation +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2017 Intel Corporation */ #include @@ -696,9 +695,6 @@ single_link_w_stats(struct test *t) static int single_link(struct test *t) { - /* const uint8_t rx_port = 0; */ - /* const uint8_t w1_port = 1; */ - /* const uint8_t w3_port = 3; */ const uint8_t tx_port = 2; int err; struct rte_mbuf *mbufs[3]; @@ -1001,11 +997,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; } } @@ -1021,6 +1019,7 @@ opdl_selftest(void) rte_socket_id()); if (!eventdev_func_mempool) { PMD_DRV_LOG(ERR, "ERROR creating mempool\n"); + free(t); return -1; } } @@ -1043,9 +1042,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)