projects/linux·commit fb448ce8

RDMA/core: Free DIM memory in error unwind

fb448ce8 · Leon Romanovsky <[email protected]> · 2020-07-30 11:27:19 +03:00

The memory allocated for the DIM wasn't freed in in error unwind path, fix
it by calling to rdma_dim_destroy().

Fixes: da6629793aa6 ("RDMA/core: Provide RDMA DIM support for ULPs")
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
Reviewed-by: Max Gurtovoy <[email protected] <mailto:[email protected]>>
Signed-off-by: Jason Gunthorpe <[email protected]>
Commit
fb448ce87a4a9482b084e67faf804aec79ed9b43
Parents
5d46b289

Changes

1 files changed · +1 −0

FileStatusAddDelContent
drivers/infiniband/core/cq.cmodified+1−0View file

drivers/infiniband/core/cq.c

View file
diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c
index 33759b3..513825e 100644
--- a/drivers/infiniband/core/cq.c
+++ b/drivers/infiniband/core/cq.c
@@ -275,6 +275,7 @@ struct ib_cq *__ib_alloc_cq_user(struct ib_device *dev, void *private,
return cq;
out_destroy_cq:
+ rdma_dim_destroy(cq);
rdma_restrack_del(&cq->res);
cq->device->ops.destroy_cq(cq, udata);
out_free_wc: