mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "xuhaoyue (A)" <xuhaoyue1@hisilicon.com>
To: Miaoqian Lin <linmq006@gmail.com>,
	Wenpeng Liang <liangwenpeng@huawei.com>,
	Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
	Yixing Liu <liuyixing1@huawei.com>, <linux-rdma@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RDMA/hns: Fix refcount leak in hns_roce_mmap
Date: Fri, 23 Dec 2022 11:51:34 +0800	[thread overview]
Message-ID: <a7632fa8-450b-a0ba-2a5d-648017dcdbb0@hisilicon.com> (raw)
In-Reply-To: <20221220113047.1463078-1-linmq006@gmail.com>

Thank you. This patch is right. Could you change it to this form?

	default:
		ret = -EINVAL;
		goto out;
	}

	ret = rdma_user_mmap_io(uctx, vma, pfn, rdma_entry->npages * PAGE_SIZE,
				prot, rdma_entry);
out:
	rdma_user_mmap_entry_put(rdma_entry);
	return ret;

On 2022/12/20 19:30:47, Miaoqian Lin wrote:
> rdma_user_mmap_entry_get_pgoff() takes reference.
> Add missing rdma_user_mmap_entry_put() to release the reference.
> 
> Fixes: 0045e0d3f42e ("RDMA/hns: Support direct wqe of userspace")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
> index 8ba68ac12388..fbff8df9236d 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_main.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_main.c
> @@ -443,6 +443,7 @@ static int hns_roce_mmap(struct ib_ucontext *uctx, struct vm_area_struct *vma)
>  		prot = pgprot_device(vma->vm_page_prot);
>  		break;
>  	default:
> +		rdma_user_mmap_entry_put(rdma_entry);
>  		return -EINVAL;
>  	}
>  
> 

      reply	other threads:[~2022-12-23  3:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20 11:30 Miaoqian Lin
2022-12-23  3:51 ` xuhaoyue (A) [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=a7632fa8-450b-a0ba-2a5d-648017dcdbb0@hisilicon.com \
    --to=xuhaoyue1@hisilicon.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=liangwenpeng@huawei.com \
    --cc=linmq006@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=liuyixing1@huawei.com \
    /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®