Skip to contentSkip to conversation

net/pcap: fix memory leak

PATCH Applied Qi Zhang 2 participants 3 messages Jan 30, 2019 – Feb 7, 2019 Network drivers

lore
Share & tools
lore

Qi Zhang

author
#0 lore raw

PATCH 1/1 net/pcap: fix memory leak

Fix potential memory leak due to kvlist not be freed.

Fixes 0d0dd2d9d8ff ("net/pcap: enable data path for secondary process")
---
 drivers/net/pcap/rte_eth_pcap.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/pcap/rte_eth_pcap.c +3 -2
index 9fd932772..65bbd7e2f 100644
@@ -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,
Signature · 1 line
2.13.6