Skip to content

Commit

Permalink
RDMA/rxe: Fix memleak in rxe_mem_init_user
Browse files Browse the repository at this point in the history
When page_address() fails, umem should be freed just like when
rxe_mem_alloc() fails.

Fixes: 8700e3e ("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>
  • Loading branch information
Dinghao Liu authored and Jason Gunthorpe committed Aug 27, 2020
1 parent 60b1af6 commit e3ddd60
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/infiniband/sw/rxe/rxe_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
err = -ENOMEM;
goto err1;
}
Expand Down

0 comments on commit e3ddd60

Please sign in to comment.