[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=hENdh9Lk1o6cknBptUHnQXLDUD=skuuD4rF+eLt3X4HTt0g@mail.gmail.com>
Date: Wed, 19 Aug 2020 16:38:50 +0800
From: Zhu Yanjun <zyjzyj2000@...il.com>
To: Dinghao Liu <dinghao.liu@....edu.cn>
Cc: kjlu@....edu, Zhu Yanjun <yanjunz@...lanox.com>,
Doug Ledford <dledford@...hat.com>,
Jason Gunthorpe <jgg@...pe.ca>, linux-rdma@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] RDMA/rxe: Fix memleak in rxe_mem_init_user
On Wed, Aug 19, 2020 at 3:59 PM Dinghao Liu <dinghao.liu@....edu.cn> wrote:
>
> When page_address() fails, umem should be freed just
> like when rxe_mem_alloc() fails.
>
> Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
> ---
> drivers/infiniband/sw/rxe/rxe_mr.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
> index cdd811a45120..ce24144de16a 100644
> --- a/drivers/infiniband/sw/rxe/rxe_mr.c
> +++ b/drivers/infiniband/sw/rxe/rxe_mr.c
> @@ -205,6 +205,7 @@ int rxe_mem_init_user(struct rxe_pd *pd, u64 start,
> vaddr = page_address(sg_page_iter_page(&sg_iter));
> if (!vaddr) {
> pr_warn("null vaddr\n");
> + ib_umem_release(umem);
seems reasonable.
Thanks,
Zhu Yanjun
> err = -ENOMEM;
> goto err1;
> }
> --
> 2.17.1
>
Powered by blists - more mailing lists