DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: ferruh.yigit@intel.com
Cc: dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/pcap: fix memory leak
Date: Wed, 30 Jan 2019 09:08:54 +0800	[thread overview]
Message-ID: <20190130010854.27352-1-qi.z.zhang@intel.com> (raw)

Fix potential memory leak due to kvlist not be freed.

Fixes: 0d0dd2d9d8ff ("net/pcap: enable data path for secondary process")
Cc: stable@dpdk.org

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/pcap/rte_eth_pcap.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 9fd932772..65bbd7e2f 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -1258,7 +1258,8 @@ pmd_pcap_probe(struct rte_vdev_device *dev)
 		if (pp == NULL) {
 			PMD_LOG(ERR,
 				"Failed to allocate memory for process private");
-			return -1;
+			ret = -1;
+			goto free_kvlist;
 		}
 
 		eth_dev->dev_ops = &ops;
@@ -1281,7 +1282,7 @@ pmd_pcap_probe(struct rte_vdev_device *dev)
 			eth_dev->tx_pkt_burst = eth_pcap_tx;
 
 		rte_eth_dev_probing_finish(eth_dev);
-		return 0;
+		goto free_kvlist;
 	}
 
 	ret = eth_from_pcaps(dev, &pcaps, pcaps.num_of_queue, &dumpers,
-- 
2.13.6

             reply	other threads:[~2019-01-30  1:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30  1:08 Qi Zhang [this message]
2019-01-30 11:30 ` Ferruh Yigit
2019-02-07 12:29   ` Ferruh Yigit

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=20190130010854.27352-1-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.org \
    /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).