Skip to content

Commit 7cf5b78

Browse files
matanb10gregkh
authored andcommitted
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: 225c7b1 ('IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters') Signed-off-by: Matan Barak <matanb@mellanox.com> Signed-off-by: Daniel Jurgens <danielj@mellanox.com> Reviewed-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 41664d7 commit 7cf5b78

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • drivers/infiniband/hw/mlx4

drivers/infiniband/hw/mlx4/cq.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,14 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev,
253253
if (context)
254254
if (ib_copy_to_udata(udata, &cq->mcq.cqn, sizeof (__u32))) {
255255
err = -EFAULT;
256-
goto err_dbmap;
256+
goto err_cq_free;
257257
}
258258

259259
return &cq->ibcq;
260260

261+
err_cq_free:
262+
mlx4_cq_free(dev->dev, &cq->mcq);
263+
261264
err_dbmap:
262265
if (context)
263266
mlx4_ib_db_unmap_user(to_mucontext(context), &cq->db);

0 commit comments

Comments
 (0)