From: Xueming Li Date: Thu, 4 Nov 2021 12:33:11 +0000 (+0800) Subject: net/mlx5: fix Rx queue memory allocation return value X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fdb67b84a52970ae06b54464a449b6f503f5a7ab;p=dpdk.git net/mlx5: fix Rx queue memory allocation return value If error happened during Rx queue mbuf allocation, boolean value returned. From description, return value should be error number. This patch returns negative error number. Fixes: 0f20acbf5eda ("net/mlx5: implement vectorized MPRQ burst") Cc: stable@dpdk.org Signed-off-by: Xueming Li Acked-by: Viacheslav Ovsiienko --- diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 9220bb2c15..4567b43c1b 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -129,7 +129,7 @@ error: * Pointer to RX queue structure. * * @return - * 0 on success, errno value on failure. + * 0 on success, negative errno value on failure. */ static int rxq_alloc_elts_sprq(struct mlx5_rxq_ctrl *rxq_ctrl) @@ -220,7 +220,7 @@ error: * Pointer to RX queue structure. * * @return - * 0 on success, errno value on failure. + * 0 on success, negative errno value on failure. */ int rxq_alloc_elts(struct mlx5_rxq_ctrl *rxq_ctrl) @@ -233,7 +233,9 @@ rxq_alloc_elts(struct mlx5_rxq_ctrl *rxq_ctrl) */ if (mlx5_rxq_mprq_enabled(&rxq_ctrl->rxq)) ret = rxq_alloc_elts_mprq(rxq_ctrl); - return (ret || rxq_alloc_elts_sprq(rxq_ctrl)); + if (ret == 0) + ret = rxq_alloc_elts_sprq(rxq_ctrl); + return ret; } /**