]> git.baikalelectronics.ru Git - kernel.git/commitdiff
RDMA/core: Free DIM memory in error unwind
authorLeon Romanovsky <leonro@mellanox.com>
Thu, 30 Jul 2020 08:27:19 +0000 (11:27 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 30 Jul 2020 14:03:33 +0000 (11:03 -0300)
The memory allocated for the DIM wasn't freed in in error unwind path, fix
it by calling to rdma_dim_destroy().

Fixes: afa59541a95f ("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 <leonro@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com <mailto:maxg@mellanox.com>>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/cq.c

index 33759b39c3d3b1c18cc5d86f5765980c890f383f..513825e424bffa57efe7a4f47f327961b5e7ba1f 100644 (file)
@@ -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: