aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2017-06-22 18:18:07 +0530
committerThomas Monjalon <thomas@monjalon.net>2017-07-21 09:27:58 +0300
commit6ed4390e5e16ddc836279946591618527cd69544 (patch)
tree21b064e9617444c85bfc548eebeba0eea9385b86
parent6a60f7de06421db8125c5c8b6d6ab87257c09759 (diff)
mempool/dpaa2: fix error code for allocation failure
In case the alloc api is not able to allocate the required number of buffer, it can return '0', which will not indicate the failure to the calling function. This patch fix the return value to indicate the failure. Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com> Reviewed-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
-rw-r--r--drivers/mempool/dpaa2/dpaa2_hw_mempool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
index 71ae0d635..14ca226f3 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -300,7 +300,7 @@ rte_dpaa2_mbuf_alloc_bulk(struct rte_mempool *pool,
/* Releasing all buffers allocated */
rte_dpaa2_mbuf_release(pool, obj_table, bpid,
bp_info->meta_data_size, n);
- return ret;
+ return -ENOBUFS;
}
/* assigning mbuf from the acquired objects */
for (i = 0; (i < ret) && bufs[i]; i++) {