aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-12-01 12:43:56 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-12-01 12:43:56 +0000
commit211bde9af9bf8f77c4d1fd1ffaa80bbbe5677229 (patch)
tree35fcddeac0757de6e37b847dba7259f04cf147ea
parentf60b672f933bc816328d12d47e68a9e1ca14f0ff (diff)
downloadsrc-211bde9af9bf8f77c4d1fd1ffaa80bbbe5677229.tar.gz
src-211bde9af9bf8f77c4d1fd1ffaa80bbbe5677229.zip
MFC r367715:
Fix error handling order in create_kernel_qp in mlx5ib. Make sure order of cleanup is exactly the opposite of initialization. Linux commit: f4044dac63e952ac1137b6df02b233d37696e2f5 Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes
Notes: svn path=/stable/11/; revision=368218
-rw-r--r--sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c
index 3af655be2c25..68a1c8cc25df 100644
--- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c
+++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c
@@ -987,12 +987,12 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev,
return 0;
err_wrid:
- mlx5_db_free(dev->mdev, &qp->db);
kfree(qp->sq.wqe_head);
kfree(qp->sq.w_list);
kfree(qp->sq.wrid);
kfree(qp->sq.wr_data);
kfree(qp->rq.wrid);
+ mlx5_db_free(dev->mdev, &qp->db);
err_free:
kvfree(*in);
@@ -1007,12 +1007,12 @@ err_uuar:
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.w_list);
kfree(qp->sq.wrid);
kfree(qp->sq.wr_data);
kfree(qp->rq.wrid);
+ mlx5_db_free(dev->mdev, &qp->db);
mlx5_buf_free(dev->mdev, &qp->buf);
free_uuar(&dev->mdev->priv.uuari, qp->bf->uuarn);
}