mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-06 05:03:13 +09:00
RDMA/rxe: Fix memleak in rxe_mem_init_user
[ Upstream commite3ddd6067e] When page_address() fails, umem should be freed just like when rxe_mem_alloc() fails. Fixes:8700e3e7c4("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>
This commit is contained in:
@@ -205,6 +205,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user