Thread (134 messages) 134 messages, 4 authors, 2016-12-01
STALE3507d REVIEWED: 1 (0M)

[PATCH 3.12 078/127] IB/mlx4: Fix create CQ error flow

From: Jiri Slaby <hidden>
Date: 2016-11-25 08:32:53
Also in: lkml
Subsystem: infiniband subsystem, mellanox mlx4 ib driver, the rest · Maintainers: Jason Gunthorpe, Leon Romanovsky, Yishai Hadas, Linus Torvalds

From: Matan Barak <redacted>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

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 <redacted>
Signed-off-by: Daniel Jurgens <redacted>
Reviewed-by: Mark Bloch <redacted>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <redacted>
Signed-off-by: Jiri Slaby <redacted>
---
 drivers/infiniband/hw/mlx4/cq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index d5e60f44ba5a..5b8a62c6bc8d 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -239,11 +239,14 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, int entries, int vector
 	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;
 
+err_cq_free:
+	mlx4_cq_free(dev->dev, &cq->mcq);
+
 err_dbmap:
 	if (context)
 		mlx4_ib_db_unmap_user(to_mucontext(context), &cq->db);
-- 
2.10.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help