[dpdk-stable] patch 'mbuf: fix error handling on pool creation' has been queued to stable release 16.07.1

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Oct 12 08:44:24 CEST 2016


Hi,

FYI, your patch has been queued to stable release 16.07.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 this Friday.
So please shutout if anyone has objections.

Thanks.

	--yliu

---
>From 078f524457bee1b73e89f435832ff89fcb63a480 Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz at 6wind.com>
Date: Mon, 19 Sep 2016 14:34:41 +0200
Subject: [PATCH] mbuf: fix error handling on pool creation

[ upstream commit 4e8739e9bb5aa125dbc964ad49caaf876d616b41 ]

On error, the mempool object has to be freed, and rte_errno should be a
positive value.

Fixes: 152ca517900b ("mbuf: use default mempool handler from config")

Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
---
 lib/librte_mbuf/rte_mbuf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 4846b89..d2c8752 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -174,10 +174,12 @@ rte_pktmbuf_pool_create(const char *name, unsigned n,
 	if (mp == NULL)
 		return NULL;
 
-	rte_errno = rte_mempool_set_ops_byname(mp,
-			RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL);
-	if (rte_errno != 0) {
+	ret = rte_mempool_set_ops_byname(mp,
+		RTE_MBUF_DEFAULT_MEMPOOL_OPS, NULL);
+	if (ret != 0) {
 		RTE_LOG(ERR, MBUF, "error setting mempool handler\n");
+		rte_mempool_free(mp);
+		rte_errno = -ret;
 		return NULL;
 	}
 	rte_pktmbuf_pool_init(mp, &mbp_priv);
-- 
1.9.0



More information about the stable mailing list