patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] patch 'mbuf: fix error handling on pool creation' has been queued to stable release 16.07.1
@ 2016-10-12  6:44 Yuanhan Liu
  0 siblings, 0 replies; only message in thread
From: Yuanhan Liu @ 2016-10-12  6:44 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dpdk stable

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@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@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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-12  6:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-12  6:44 [dpdk-stable] patch 'mbuf: fix error handling on pool creation' has been queued to stable release 16.07.1 Yuanhan Liu

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