From: Cheng Xu <chengyou@linux.alibaba.com>
To: Miaoqian Lin <linmq006@gmail.com>,
Kai Shen <kaishen@linux.alibaba.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
Wei Yongjun <weiyongjun1@huawei.com>,
Yang Li <yang.lee@linux.alibaba.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/erdma: Fix refcount leak in erdma_mmap
Date: Wed, 21 Dec 2022 10:58:35 +0800 [thread overview]
Message-ID: <aefc7c5e-df05-9cfa-fa43-6a142d7cb527@linux.alibaba.com> (raw)
In-Reply-To: <20221220121139.1540564-1-linmq006@gmail.com>
On 12/20/22 8:11 PM, Miaoqian Lin wrote:
> rdma_user_mmap_entry_get() take reference, we should release it when not
> need anymore, add the missing rdma_user_mmap_entry_put() in the error
> path to fix it.
>
> Fixes: 155055771704 ("RDMA/erdma: Add verbs implementation")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
> drivers/infiniband/hw/erdma/erdma_verbs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
Good catch, thanks.
Acked-by: Cheng Xu <chengyou@linux.alibaba.com>
> diff --git a/drivers/infiniband/hw/erdma/erdma_verbs.c b/drivers/infiniband/hw/erdma/erdma_verbs.c
> index 5dab1e87975b..9c30d78730aa 100644
> --- a/drivers/infiniband/hw/erdma/erdma_verbs.c
> +++ b/drivers/infiniband/hw/erdma/erdma_verbs.c
> @@ -1110,12 +1110,14 @@ int erdma_mmap(struct ib_ucontext *ctx, struct vm_area_struct *vma)
> prot = pgprot_device(vma->vm_page_prot);
> break;
> default:
> - return -EINVAL;
> + err = -EINVAL;
> + goto put_entry;
> }
>
> err = rdma_user_mmap_io(ctx, vma, PFN_DOWN(entry->address), PAGE_SIZE,
> prot, rdma_entry);
>
> +put_entry:
> rdma_user_mmap_entry_put(rdma_entry);
> return err;
> }
next prev parent reply other threads:[~2022-12-21 2:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-20 12:11 Miaoqian Lin
2022-12-21 2:58 ` Cheng Xu [this message]
2022-12-28 9:59 ` Leon Romanovsky
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=aefc7c5e-df05-9cfa-fa43-6a142d7cb527@linux.alibaba.com \
--to=chengyou@linux.alibaba.com \
--cc=jgg@ziepe.ca \
--cc=kaishen@linux.alibaba.com \
--cc=leon@kernel.org \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=weiyongjun1@huawei.com \
--cc=yang.lee@linux.alibaba.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®