linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] RDMA/rxe: Fix memleak in rxe_mem_init_user
@ 2020-08-19  7:56 Dinghao Liu
  2020-08-19  8:38 ` Zhu Yanjun
  2020-08-27 11:47 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Dinghao Liu @ 2020-08-19  7:56 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Zhu Yanjun, Doug Ledford, Jason Gunthorpe, linux-rdma, linux-kernel

When page_address() fails, umem should be freed just
like when rxe_mem_alloc() fails.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/infiniband/sw/rxe/rxe_mr.c | 1 +
 1 file changed, 1 insertion(+)

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;
 			}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-27 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-19  7:56 [PATCH] RDMA/rxe: Fix memleak in rxe_mem_init_user Dinghao Liu
2020-08-19  8:38 ` Zhu Yanjun
2020-08-27 11:47 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).