DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ring: fix minor memory free issue
@ 2015-11-06 17:28 John McNamara
  2015-11-06 17:40 ` [dpdk-dev] [PATCH v2] " John McNamara
  2015-11-06 23:09 ` [dpdk-dev] [PATCH] " Thomas Monjalon
  0 siblings, 2 replies; 3+ messages in thread
From: John McNamara @ 2015-11-06 17:28 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev

Fix minor memory free issue in error clean-up.

Reported-by Coverity (CID 119258)

Signed-off-by: John McNamara <john.mcnamara@intel.com>
---
 drivers/net/ring/rte_eth_ring.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index cc60008..9a31bce 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -363,8 +363,10 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
 	return data->port_id;
 
 error:
-	rte_free(data->rx_queues);
-	rte_free(data->tx_queues);
+	if (data) {
+		rte_free(data->rx_queues);
+		rte_free(data->tx_queues);
+	}
 	rte_free(data);
 	rte_free(internals);
 
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-06 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06 17:28 [dpdk-dev] [PATCH] ring: fix minor memory free issue John McNamara
2015-11-06 17:40 ` [dpdk-dev] [PATCH v2] " John McNamara
2015-11-06 23:09 ` [dpdk-dev] [PATCH] " Thomas Monjalon

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).