mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Jing Xiangfeng <jingxiangfeng@huawei.com>,
	mst@redhat.com, eli@mellanox.com, parav@mellanox.com,
	alex.dewar@gmx.co.uk
Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vdpa/mlx5: Fix error return in map_direct_mr()
Date: Tue, 27 Oct 2020 10:44:15 +0800	[thread overview]
Message-ID: <8e37340d-2b4f-caaf-3277-32a697b2d204@redhat.com> (raw)
In-Reply-To: <20201026070637.164321-1-jingxiangfeng@huawei.com>


On 2020/10/26 下午3:06, 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@huawei.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);


Acked-by: Jason Wang <jasowang@redhat.com>



      parent reply	other threads:[~2020-10-27  2:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26  7:06 Jing Xiangfeng
2020-10-26  7:13 ` Eli Cohen
2020-10-27  2:44 ` Jason Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e37340d-2b4f-caaf-3277-32a697b2d204@redhat.com \
    --to=jasowang@redhat.com \
    --cc=alex.dewar@gmx.co.uk \
    --cc=eli@mellanox.com \
    --cc=jingxiangfeng@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=parav@mellanox.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®