From: Hemant Agrawal Date: Thu, 22 Jun 2017 12:48:07 +0000 (+0530) Subject: mempool/dpaa2: fix error code for allocation failure X-Git-Tag: spdx-start~2376 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6ed4390e5e16ddc836279946591618527cd69544;p=dpdk.git 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 Reviewed-by: Olivier Matz Acked-by: Shreyansh Jain --- diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index 71ae0d635c..14ca226f3e 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++) {