diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-08-19 15:56:32 +0800 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2020-08-27 08:45:59 -0300 |
commit | e3ddd6067ee62f6e76ebcf61ff08b2c729ae412b (patch) | |
tree | 61ee5949856b92dbd1bd8255f84d1718569bad22 /drivers/infiniband | |
parent | 60b1af64eb35074a4f2d41cc1e503a7671e68963 (diff) |
RDMA/rxe: Fix memleak in rxe_mem_init_user
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>
Diffstat (limited to 'drivers/infiniband')
-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 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); err = -ENOMEM; goto err1; } |