[dpdk-stable] patch 'net/sfc: fix leak if EvQ DMA space allocation fails' has been queued to stable release 17.02.1

Yuanhan Liu yuanhan.liu at linux.intel.com
Thu May 25 11:48:25 CEST 2017


Hi,

FYI, your patch has been queued to stable release 17.02.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/28/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From f73204cd85b3bbbb4ac6122faf6a6806f1c848a7 Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko at solarflare.com>
Date: Wed, 29 Mar 2017 09:28:25 +0100
Subject: [PATCH] net/sfc: fix leak if EvQ DMA space allocation fails

[ upstream commit 0c16506e5947f65f4d4ff3a4c3e428e52158e5de ]

Fixes: 58294ee65afb ("net/sfc: support event queue")

Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 drivers/net/sfc/sfc_ev.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/sfc_ev.c b/drivers/net/sfc/sfc_ev.c
index f717faa..c86f732 100644
--- a/drivers/net/sfc/sfc_ev.c
+++ b/drivers/net/sfc/sfc_ev.c
@@ -615,10 +615,11 @@ sfc_ev_qinit(struct sfc_adapter *sa, unsigned int sw_index,
 	SFC_ASSERT(entries <= evq_info->max_entries);
 	evq_info->entries = entries;
 
+	rc = ENOMEM;
 	evq = rte_zmalloc_socket("sfc-evq", sizeof(*evq), RTE_CACHE_LINE_SIZE,
 				 socket_id);
 	if (evq == NULL)
-		return ENOMEM;
+		goto fail_evq_alloc;
 
 	evq->sa = sa;
 	evq->evq_index = sw_index;
@@ -627,13 +628,21 @@ sfc_ev_qinit(struct sfc_adapter *sa, unsigned int sw_index,
 	rc = sfc_dma_alloc(sa, "evq", sw_index, EFX_EVQ_SIZE(evq_info->entries),
 			   socket_id, &evq->mem);
 	if (rc != 0)
-		return rc;
+		goto fail_dma_alloc;
 
 	evq->init_state = SFC_EVQ_INITIALIZED;
 
 	evq_info->evq = evq;
 
 	return 0;
+
+fail_dma_alloc:
+	rte_free(evq);
+
+fail_evq_alloc:
+
+	sfc_log_init(sa, "failed %d", rc);
+	return rc;
 }
 
 void
-- 
1.9.0



More information about the stable mailing list