diff options
author | Olivier Matz <olivier.matz@6wind.com> | 2016-07-11 12:20:26 +0200 |
---|---|---|
committer | Thomas Monjalon <thomas.monjalon@6wind.com> | 2016-07-11 19:10:09 +0200 |
commit | 996e86bf2a74b671225d7a59c0d1eddbec881401 (patch) | |
tree | b0a672a974c61a1ef512fe222a02e9809dd55556 /lib | |
parent | e33c4d97913e06b46573a9a43beaf979f8444790 (diff) | |
download | dpdk-996e86bf2a74b671225d7a59c0d1eddbec881401.zip dpdk-996e86bf2a74b671225d7a59c0d1eddbec881401.tar.gz dpdk-996e86bf2a74b671225d7a59c0d1eddbec881401.tar.xz |
mbuf: set errno on pool creation error
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 <olivier.matz@6wind.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/librte_mbuf/rte_mbuf.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |