summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2017-06-22 18:18:07 +0530
committerYuanhan Liu <yliu@fridaylinux.org>2017-08-29 14:50:28 +0800
commit8cc83e846441b896b7ca1379c8b83ad0b2cf169b (patch)
treee2c2f35a1bf7528fc0a92787e18f444ce886f9bd
parent5dac9b55e2795ee901cdb85b14a6c2705a550ab6 (diff)
downloaddpdk-stable-8cc83e846441b896b7ca1379c8b83ad0b2cf169b.zip
dpdk-stable-8cc83e846441b896b7ca1379c8b83ad0b2cf169b.tar.gz
dpdk-stable-8cc83e846441b896b7ca1379c8b83ad0b2cf169b.tar.xz
mempool/dpaa2: fix error code for allocation failure
[ upstream commit 6ed4390e5e16ddc836279946591618527cd69544 ] 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") 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 5a5d6aa..27ed5a9 100644
--- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
+++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c
@@ -294,7 +294,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++) {