From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B780A6CB7 for ; Wed, 12 Oct 2016 08:43:43 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP; 11 Oct 2016 23:43:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,332,1473145200"; d="scan'208";a="19186329" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga004.jf.intel.com with ESMTP; 11 Oct 2016 23:43:42 -0700 Date: Wed, 12 Oct 2016 14:44:24 +0800 From: Yuanhan Liu To: Olivier Matz Cc: dpdk stable Message-ID: <57fddbc8.67C3X6YYeYGU1UPI%yuanhan.liu@linux.intel.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [dpdk-stable] patch 'mbuf: fix error handling on pool creation' has been queued to stable release 16.07.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2016 06:43:44 -0000 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 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 --- 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