Commit 76a93a6f authored by Matan Barak's avatar Matan Barak Committed by Greg Kroah-Hartman

IB/mlx4: Fix create CQ error flow

commit 593ff73b upstream.

Currently, if ib_copy_to_udata fails, the CQ
won't be deleted from the radix tree and the HW (HW2SW).

Fixes: 225c7b1f ('IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters')
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Signed-off-by: default avatarDaniel Jurgens <danielj@mellanox.com>
Reviewed-by: default avatarMark Bloch <markb@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4234e6a0
...@@ -253,11 +253,14 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, ...@@ -253,11 +253,14 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev,
if (context) if (context)
if (ib_copy_to_udata(udata, &cq->mcq.cqn, sizeof (__u32))) { if (ib_copy_to_udata(udata, &cq->mcq.cqn, sizeof (__u32))) {
err = -EFAULT; err = -EFAULT;
goto err_dbmap; goto err_cq_free;
} }
return &cq->ibcq; return &cq->ibcq;
err_cq_free:
mlx4_cq_free(dev->dev, &cq->mcq);
err_dbmap: err_dbmap:
if (context) if (context)
mlx4_ib_db_unmap_user(to_mucontext(context), &cq->db); mlx4_ib_db_unmap_user(to_mucontext(context), &cq->db);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment