path: root/drivers
diff options
authorMatan Barak <>2016-11-10 11:30:55 +0200
committerGreg Kroah-Hartman <>2016-11-26 09:56:58 +0100
commit76a93a6f8dd7ee2468fd0ccb83e2112b94a886db (patch)
tree40c6483944c97fa434975a9288264f8a75fed5f9 /drivers
parent4234e6a06f8bc04679bc827a475d9daeba359761 (diff)
IB/mlx4: Fix create CQ error flow
commit 593ff73bcfdc79f79a8a0df55504f75ad3e5d1a9 upstream. Currently, if ib_copy_to_udata fails, the CQ won't be deleted from the radix tree and the HW (HW2SW). Fixes: 225c7b1feef1 ('IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters') Signed-off-by: Matan Barak <> Signed-off-by: Daniel Jurgens <> Reviewed-by: Mark Bloch <> Signed-off-by: Leon Romanovsky <> Signed-off-by: Doug Ledford <> Signed-off-by: Greg Kroah-Hartman <>
Diffstat (limited to 'drivers')
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index 5df63dacaaa3..efb6414cc5e4 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -253,11 +253,14 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev,
if (context)
if (ib_copy_to_udata(udata, &cq->mcq.cqn, sizeof (__u32))) {
err = -EFAULT;
- goto err_dbmap;
+ goto err_cq_free;
return &cq->ibcq;
+ mlx4_cq_free(dev->dev, &cq->mcq);
if (context)
mlx4_ib_db_unmap_user(to_mucontext(context), &cq->db);