提交 f4044dac 编写于 作者: E Eli Cohen 提交者: Leon Romanovsky

IB/mlx5: Fix error handling order in create_kernel_qp

Make sure order of cleanup is exactly the opposite of initialization.

Fixes: 9603b61d ('mlx5: Move pci device handling from mlx5_ib to mlx5_core')
Signed-off-by: NEli Cohen <eli@mellanox.com>
Reviewed-by: NMatan Barak <matanb@mellanox.com>
Signed-off-by: NLeon Romanovsky <leon@kernel.org>
Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
上级 de8d6e02
...@@ -994,12 +994,12 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, ...@@ -994,12 +994,12 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev,
return 0; return 0;
err_wrid: err_wrid:
mlx5_db_free(dev->mdev, &qp->db);
kfree(qp->sq.wqe_head); kfree(qp->sq.wqe_head);
kfree(qp->sq.w_list); kfree(qp->sq.w_list);
kfree(qp->sq.wrid); kfree(qp->sq.wrid);
kfree(qp->sq.wr_data); kfree(qp->sq.wr_data);
kfree(qp->rq.wrid); kfree(qp->rq.wrid);
mlx5_db_free(dev->mdev, &qp->db);
err_free: err_free:
kvfree(*in); kvfree(*in);
...@@ -1014,12 +1014,12 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev, ...@@ -1014,12 +1014,12 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev,
static void destroy_qp_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp) static void destroy_qp_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp)
{ {
mlx5_db_free(dev->mdev, &qp->db);
kfree(qp->sq.wqe_head); kfree(qp->sq.wqe_head);
kfree(qp->sq.w_list); kfree(qp->sq.w_list);
kfree(qp->sq.wrid); kfree(qp->sq.wrid);
kfree(qp->sq.wr_data); kfree(qp->sq.wr_data);
kfree(qp->rq.wrid); kfree(qp->rq.wrid);
mlx5_db_free(dev->mdev, &qp->db);
mlx5_buf_free(dev->mdev, &qp->buf); mlx5_buf_free(dev->mdev, &qp->buf);
free_uuar(&dev->mdev->priv.uuari, qp->bf->uuarn); free_uuar(&dev->mdev->priv.uuari, qp->bf->uuarn);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册