From: Leon Romanovsky Date: Thu, 30 Jul 2020 08:27:19 +0000 (+0300) Subject: RDMA/core: Free DIM memory in error unwind X-Git-Tag: v5.7.13~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=67a153c6a469d8741a160ef45f22f2f39f45b8c3;p=thirdparty%2Fkernel%2Fstable.git RDMA/core: Free DIM memory in error unwind [ Upstream commit fb448ce87a4a9482b084e67faf804aec79ed9b43 ] 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/20200730082719.1582397-4-leon@kernel.org Signed-off-by: Leon Romanovsky Reviewed-by: Max Gurtovoy > Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c index c259f632f257f..6bb62d04030ac 100644 --- a/drivers/infiniband/core/cq.c +++ b/drivers/infiniband/core/cq.c @@ -270,6 +270,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: