[dpdk-stable] [PATCH v2 1/2] mempool/dpaa2: fix the return value for alloc fail

Hemant Agrawal hemant.agrawal at nxp.com
Thu Jun 22 14:48:07 CEST 2017


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 at dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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++) {
-- 
2.7.4



More information about the stable mailing list