diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-08-19 10:56:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-23 11:46:25 +0300 |
commit | 557f256d510e3714b1da60b4c0e42bc47459fca1 (patch) | |
tree | 09d6ac4380f8b573cf742e47efd8f79bc71f535a /drivers | |
parent | d406edabe7483cccfa82b15926c418b9b1f26936 (diff) | |
download | linux-557f256d510e3714b1da60b4c0e42bc47459fca1.tar.xz |
RDMA/rxe: Fix memleak in rxe_mem_init_user
[ Upstream commit e3ddd6067ee62f6e76ebcf61ff08b2c729ae412b ]
When page_address() fails, umem should be freed just like when
rxe_mem_alloc() fails.
Fixes: 8700e3e7c485 ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20200819075632.22285-1-dinghao.liu@zju.edu.cn
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/sw/rxe/rxe_mr.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c index 5c2684bf430f..a0d2a2350c7e 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -203,6 +203,7 @@ int rxe_mem_init_user(struct rxe_dev *rxe, struct rxe_pd *pd, u64 start, vaddr = page_address(sg_page(sg)); if (!vaddr) { pr_warn("null vaddr\n"); + ib_umem_release(umem); err = -ENOMEM; goto err1; } |