[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <427b1f96-9e41-a1e3-1ce5-09fc38799e69@redhat.com>
Date: Mon, 12 Apr 2021 17:45:34 +0800
From: Jason Wang <jasowang@...hat.com>
To: Eli Cohen <elic@...dia.com>, mst@...hat.com, si-wei.liu@...cle.com,
virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org
Cc: kernel test robot <lkp@...el.com>,
Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH] vdpa/mlx5: Set err = -ENOMEM in case dma_map_sg_attrs
fails
在 2021/4/11 下午4:36, Eli Cohen 写道:
> Set err = -ENOMEM if dma_map_sg_attrs() fails so the function reutrns
> error.
>
> Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code")
> Signed-off-by: Eli Cohen <elic@...dia.com>
> Reported-by: kernel test robot <lkp@...el.com>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> ---
> drivers/vdpa/mlx5/core/mr.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/mlx5/core/mr.c b/drivers/vdpa/mlx5/core/mr.c
> index 3908ff28eec0..800cfd1967ad 100644
> --- a/drivers/vdpa/mlx5/core/mr.c
> +++ b/drivers/vdpa/mlx5/core/mr.c
> @@ -278,8 +278,10 @@ static int map_direct_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_direct_mr
> mr->log_size = log_entity_size;
> mr->nsg = nsg;
> mr->nent = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
> - if (!mr->nent)
> + if (!mr->nent) {
> + err = -ENOMEM;
> goto err_map;
> + }
>
> err = create_direct_mr(mvdev, mr);
> if (err)
Acked-by: Jason Wang <jasowang@...hat.com>
Powered by blists - more mailing lists