DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Shepard Siegel <shepard.siegel@atomicrules.com>; Ed Czeck
	<ed.czeck@atomicrules.com>; John Miller
	<john.miller@atomicrules.com>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH] net/ark: fix kvargs memory leak
Date: Fri, 28 Apr 2017 08:43:11 +0100	[thread overview]
Message-ID: <20170428074311.31605-1-ferruh.yigit@intel.com> (raw)

Coverity issue: 1428042
Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
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

             reply	other threads:[~2017-04-28  7:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28  7:43 Ferruh Yigit [this message]
2017-05-01 20:36 ` Thomas Monjalon
2017-05-01 16:01 john miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170428074311.31605-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=shepard.siegel@atomicrules.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).