From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5A24B1B1A5 for ; Wed, 24 Jan 2018 16:05:40 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2018 07:05:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,408,1511856000"; d="scan'208";a="12697234" Received: from silpixa00398162.ir.intel.com (HELO silpixa00398162.ger.corp.intel.com) ([10.237.223.171]) by fmsmga007.fm.intel.com with ESMTP; 24 Jan 2018 07:05:38 -0800 From: Liang Ma To: dev@dpdk.org Cc: harry.van.haaren@intel.com, bruce.richardson@intel.com, peter.mccarthy@intel.com, jerin.jacob@caviumnetworks.com Date: Wed, 24 Jan 2018 15:05:50 +0000 Message-Id: <1516806351-151804-1-git-send-email-liang.j.ma@intel.com> X-Mailer: git-send-email 2.7.5 Subject: [dpdk-dev] [PATCH 1/2] event/opdl: fix the resource leak issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2018 15:05:41 -0000 Fixes: d548ef513cd7 ("event/opdl: add unit tests") Coverity issue: 257004 Signed-off-by: Liang Ma --- 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