diff options
author | Matan Barak <matanb@mellanox.com> | 2016-11-10 04:30:55 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-11-16 20:03:44 -0500 |
commit | 593ff73bcfdc79f79a8a0df55504f75ad3e5d1a9 (patch) | |
tree | ee53147d4228608b6c83ba2d9fde51916da8af2c | |
parent | 37995116fecfce2b61ee3da6e73b3e394c6818f9 (diff) |
IB/mlx4: Fix create CQ error flow
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 <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>
-rw-r--r-- | drivers/infiniband/hw/mlx4/cq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c index 1ea686b9e0f9..6a0fec357dae 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, | |||
253 | if (context) | 253 | if (context) |
254 | if (ib_copy_to_udata(udata, &cq->mcq.cqn, sizeof (__u32))) { | 254 | if (ib_copy_to_udata(udata, &cq->mcq.cqn, sizeof (__u32))) { |
255 | err = -EFAULT; | 255 | err = -EFAULT; |
256 | goto err_dbmap; | 256 | goto err_cq_free; |
257 | } | 257 | } |
258 | 258 | ||
259 | return &cq->ibcq; | 259 | return &cq->ibcq; |
260 | 260 | ||
261 | err_cq_free: | ||
262 | mlx4_cq_free(dev->dev, &cq->mcq); | ||
263 | |||
261 | err_dbmap: | 264 | err_dbmap: |
262 | if (context) | 265 | if (context) |
263 | mlx4_ib_db_unmap_user(to_mucontext(context), &cq->db); | 266 | mlx4_ib_db_unmap_user(to_mucontext(context), &cq->db); |