From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 7DE592BBE for ; Mon, 11 Jul 2016 12:20:38 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 1B8BE27CFB; Mon, 11 Jul 2016 12:20:38 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org, huilongx.xu@intel.com, waterman.cao@intel.com, yuanhan.liu@intel.com, weichunx.chen@intel.com, yu.y.liu@intel.com Cc: thomas.monjalon@6wind.com Date: Mon, 11 Jul 2016 12:20:26 +0200 Message-Id: <1468232428-24088-3-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468232428-24088-1-git-send-email-olivier.matz@6wind.com> References: <1468232428-24088-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH 2/4] mbuf: set errno on pool creation error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2016 10:20:38 -0000 In rte_pktmbuf_pool_create(), the rte_errno variable was not always set on failure. Fixes: 152ca517900b ("mbuf: use default mempool handler from config") Signed-off-by: Olivier Matz --- lib/librte_mbuf/rte_mbuf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 601e528..4846b89 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -156,6 +156,7 @@ rte_pktmbuf_pool_create(const char *name, unsigned n, struct rte_mempool *mp; struct rte_pktmbuf_pool_private mbp_priv; unsigned elt_size; + int ret; if (RTE_ALIGN(priv_size, RTE_MBUF_PRIV_ALIGN) != priv_size) { RTE_LOG(ERR, MBUF, "mbuf priv_size=%u is not aligned\n", @@ -181,8 +182,10 @@ rte_pktmbuf_pool_create(const char *name, unsigned n, } rte_pktmbuf_pool_init(mp, &mbp_priv); - if (rte_mempool_populate_default(mp) < 0) { + ret = rte_mempool_populate_default(mp); + if (ret < 0) { rte_mempool_free(mp); + rte_errno = -ret; return NULL; } -- 2.8.1