lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201026071345.GB232593@mtl-vdi-166.wap.labs.mlnx>
Date:   Mon, 26 Oct 2020 09:13:45 +0200
From:   Eli Cohen <elic@...dia.com>
To:     Jing Xiangfeng <jingxiangfeng@...wei.com>
CC:     <mst@...hat.com>, <jasowang@...hat.com>, <eli@...lanox.com>,
        <parav@...lanox.com>, <alex.dewar@....co.uk>,
        <virtualization@...ts.linux-foundation.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] vdpa/mlx5: Fix error return in map_direct_mr()

On Mon, Oct 26, 2020 at 03:06:37PM +0800, Jing Xiangfeng wrote:
> Fix to return the variable "err" from the error handling case instead
> of "ret".
> 
> Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code")
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@...wei.com>

Acked-by: Eli Cohen <elic@...dia.com>

> ---
>  drivers/vdpa/mlx5/core/mr.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/vdpa/mlx5/core/mr.c b/drivers/vdpa/mlx5/core/mr.c
> index ef1c550f8266..4b6195666c58 100644
> --- a/drivers/vdpa/mlx5/core/mr.c
> +++ b/drivers/vdpa/mlx5/core/mr.c
> @@ -239,7 +239,6 @@ static int map_direct_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_direct_mr
>  	u64 paend;
>  	struct scatterlist *sg;
>  	struct device *dma = mvdev->mdev->device;
> -	int ret;
>  
>  	for (map = vhost_iotlb_itree_first(iotlb, mr->start, mr->end - 1);
>  	     map; map = vhost_iotlb_itree_next(map, start, mr->end - 1)) {
> @@ -277,8 +276,8 @@ static int map_direct_mr(struct mlx5_vdpa_dev *mvdev, struct mlx5_vdpa_direct_mr
>  done:
>  	mr->log_size = log_entity_size;
>  	mr->nsg = nsg;
> -	ret = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
> -	if (!ret)
> +	err = dma_map_sg_attrs(dma, mr->sg_head.sgl, mr->nsg, DMA_BIDIRECTIONAL, 0);
> +	if (!err)
>  		goto err_map;
>  
>  	err = create_direct_mr(mvdev, mr);
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ