diff mbox

[rdma-next] IB/mlx5: Fix wrong use of kfree at bad flow in create_cq_user

Message ID 20170329031214.6272-1-leon@kernel.org (mailing list archive)
State Accepted
Headers show

Commit Message

Leon Romanovsky March 29, 2017, 3:12 a.m. UTC
From: Bodong Wang <bodong@mellanox.com>

The kfree was called to free cqb, while it should free *cqb.

Fixes: 1cbe6fc86ccf ("IB/mlx5: Add support for CQE compressing")
Signed-off-by: Bodong Wang <bodong@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
---
 drivers/infiniband/hw/mlx5/cq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.12.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Doug Ledford April 24, 2017, 4:13 p.m. UTC | #1
On Wed, 2017-03-29 at 06:12 +0300, Leon Romanovsky wrote:
> From: Bodong Wang <bodong@mellanox.com>
> 
> The kfree was called to free cqb, while it should free *cqb.
> 
> Fixes: 1cbe6fc86ccf ("IB/mlx5: Add support for CQE compressing")
> Signed-off-by: Bodong Wang <bodong@mellanox.com>
> Signed-off-by: Leon Romanovsky <leon@kernel.org>

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
index 31803b367104..5a31cec947fa 100644
--- a/drivers/infiniband/hw/mlx5/cq.c
+++ b/drivers/infiniband/hw/mlx5/cq.c
@@ -818,7 +818,7 @@  static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
 	return 0;

 err_cqb:
-	kfree(cqb);
+	kfree(*cqb);

 err_db:
 	mlx5_ib_db_unmap_user(to_mucontext(context), &cq->db);