diff mbox

[net-next] net/mlx5e: fix error return code in mlx5e_alloc_rq()

Message ID 1515569453-63865-1-git-send-email-weiyongjun1@huawei.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Wei Yongjun Jan. 10, 2018, 7:30 a.m. UTC
Fix to return a negative error code from the xdp_rxq_info_reg() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 0ddf543226ac ("xdp/mlx5: setup xdp_rxq_info")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jesper Dangaard Brouer Jan. 10, 2018, 2:08 p.m. UTC | #1
On Wed, 10 Jan 2018 07:30:53 +0000 Wei Yongjun <weiyongjun1@huawei.com> wrote:

> Fix to return a negative error code from the xdp_rxq_info_reg() error
> handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: 0ddf543226ac ("xdp/mlx5: setup xdp_rxq_info")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> index 539bd1d..6ba6671 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> @@ -582,7 +582,8 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
>  		goto err_rq_wq_destroy;
>  	}
>  
> -	if (xdp_rxq_info_reg(&rq->xdp_rxq, rq->netdev, rq->ix) < 0)
> +	err = xdp_rxq_info_reg(&rq->xdp_rxq, rq->netdev, rq->ix);
> +	if (err < 0)
>  		goto err_rq_wq_destroy;
>  
>  	rq->buff.map_dir = rq->xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE;

Reviewed-by: Jesper Dangaard Brouer <brouer@redhat.com>

Thanks for fixing this.
David Miller Jan. 10, 2018, 8:55 p.m. UTC | #2
From: Wei Yongjun <weiyongjun1@huawei.com>
Date: Wed, 10 Jan 2018 07:30:53 +0000

> Fix to return a negative error code from the xdp_rxq_info_reg() error
> handling case instead of 0, as done elsewhere in this function.
> 
> Fixes: 0ddf543226ac ("xdp/mlx5: setup xdp_rxq_info")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 539bd1d..6ba6671 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -582,7 +582,8 @@  static int mlx5e_alloc_rq(struct mlx5e_channel *c,
 		goto err_rq_wq_destroy;
 	}
 
-	if (xdp_rxq_info_reg(&rq->xdp_rxq, rq->netdev, rq->ix) < 0)
+	err = xdp_rxq_info_reg(&rq->xdp_rxq, rq->netdev, rq->ix);
+	if (err < 0)
 		goto err_rq_wq_destroy;
 
 	rq->buff.map_dir = rq->xdp_prog ? DMA_BIDIRECTIONAL : DMA_FROM_DEVICE;