diff options
author | Dinghao Liu <dinghao.liu@zju.edu.cn> | 2020-08-19 09:56:32 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2020-08-27 13:45:59 +0200 |
commit | e3ddd6067ee62f6e76ebcf61ff08b2c729ae412b (patch) | |
tree | 61ee5949856b92dbd1bd8255f84d1718569bad22 | |
parent | RDMA/rxe: Fix the parent sysfs read when the interface has 15 chars (diff) | |
download | linux-e3ddd6067ee62f6e76ebcf61ff08b2c729ae412b.tar.xz linux-e3ddd6067ee62f6e76ebcf61ff08b2c729ae412b.zip |
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>
-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; } |