From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6F6609E3 for ; Fri, 28 Apr 2017 09:43:19 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2017 00:43:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="1162058381" Received: from sivswdev02.ir.intel.com ([10.237.217.46]) by fmsmga002.fm.intel.com with ESMTP; 28 Apr 2017 00:43:17 -0700 From: Ferruh Yigit To: Shepard Siegel ; Ed Czeck ; John Miller Cc: dev@dpdk.org, Ferruh Yigit Date: Fri, 28 Apr 2017 08:43:11 +0100 Message-Id: <20170428074311.31605-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.8.4 Subject: [dpdk-dev] [PATCH] net/ark: fix kvargs memory leak 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: Fri, 28 Apr 2017 07:43:20 -0000 Coverity issue: 1428042 Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville") Signed-off-by: Ferruh Yigit --- Please check next-net coverity project for more issues detected: https://scan.coverity.com/projects/dpdk-next-net?tab=overview --- drivers/net/ark/ark_ethdev.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 4caad98..83961f5 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -922,6 +922,7 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params) struct rte_kvargs *kvlist; unsigned int k_idx; struct rte_kvargs_pair *pair = NULL; + int ret = -1; kvlist = rte_kvargs_parse(params, valid_arguments); if (kvlist == NULL) @@ -942,7 +943,7 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params) &process_pktdir_arg, ark) != 0) { PMD_DRV_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTDIR_ARG); - return -1; + goto free_kvlist; } if (rte_kvargs_process(kvlist, @@ -950,7 +951,7 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params) &process_file_args, ark->pkt_gen_args) != 0) { PMD_DRV_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTGEN_ARG); - return -1; + goto free_kvlist; } if (rte_kvargs_process(kvlist, @@ -958,7 +959,7 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params) &process_file_args, ark->pkt_chkr_args) != 0) { PMD_DRV_LOG(ERR, "Unable to parse arg %s\n", ARK_PKTCHKR_ARG); - return -1; + goto free_kvlist; } PMD_DRV_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v); @@ -980,7 +981,12 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params) ark_pktchkr_setup(ark->pc); } - return 0; + ret = 0; + +free_kvlist: + rte_kvargs_free(kvlist); + + return ret; } RTE_PMD_REGISTER_PCI(net_ark, rte_ark_pmd); -- 2.9.3