Re: [PATCH rdma-next 07/10] IB/mlx5: Return appropriate error code instead of ENOMEM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 27, 2021 at 05:00:07PM +0200, Leon Romanovsky wrote:
> From: Parav Pandit <parav@xxxxxxxxxx>
> 
> When mlx5_ib_stage_init_init() fails, return the error code related to
> failure instead of -ENOMEM.
> 
> Fixes: 16c1975f1032 ("IB/mlx5: Create profile infrastructure to add and remove stages")
> Signed-off-by: Parav Pandit <parav@xxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx>
>  drivers/infiniband/hw/mlx5/main.c | 3 +--
>  drivers/infiniband/hw/mlx5/odp.c  | 4 ----
>  2 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index ad7bb37e501d..9e8b4d591138 100644
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -3952,8 +3952,7 @@ static int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev)
> 
>  err_mp:
>  	mlx5_ib_cleanup_multiport_master(dev);
> -
> -	return -ENOMEM;
> +	return err;
>  }
> 
>  static int mlx5_ib_enable_driver(struct ib_device *dev)
> diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
> index f4b82daf1e22..a1be8fb2800e 100644
> +++ b/drivers/infiniband/hw/mlx5/odp.c
> @@ -484,10 +484,6 @@ static struct mlx5_ib_mr *implicit_get_child_mr(struct mlx5_ib_mr *imr,
>  	}
> 
>  	xa_lock(&imr->implicit_children);
> -	/*
> -	 * Once the store to either xarray completes any error unwind has to
> -	 * use synchronize_srcu(). Avoid this with xa_reserve()
> -	 */

It is not wrong to remove this comment, but why is it in this patch?

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux