From: Miaoqian Lin <linmq006@gmail.com>
To: Haoyue Xu <xuhaoyue1@hisilicon.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
Cc: linmq006@gmail.com
Subject: [PATCH] RDMA/hns: Fix refcount leak in hns_roce_mmap
Date: Tue, 20 Dec 2022 15:30:47 +0400 [thread overview]
Message-ID: <20221220113047.1463078-1-linmq006@gmail.com> (raw)
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;
}
--
2.25.1
next reply other threads:[~2022-12-20 11:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-20 11:30 Miaoqian Lin [this message]
2022-12-23 3:51 ` xuhaoyue (A)
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=20221220113047.1463078-1-linmq006@gmail.com \
--to=linmq006@gmail.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=liangwenpeng@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=liuyixing1@huawei.com \
--cc=xuhaoyue1@hisilicon.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®