Commit 56e1ab0f authored by Moshe Lazer's avatar Moshe Lazer Committed by Roland Dreier

IB/mlx5: Fix memory leak in mlx5_ib_create_srq

The patch fixes the rollback in case of failure in creating SRQ.
Signed-off-by: default avatarMoshe Lazer <moshel@mellanox.com>
Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 3c461911
...@@ -295,7 +295,7 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, ...@@ -295,7 +295,7 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
mlx5_vfree(in); mlx5_vfree(in);
if (err) { if (err) {
mlx5_ib_dbg(dev, "create SRQ failed, err %d\n", err); mlx5_ib_dbg(dev, "create SRQ failed, err %d\n", err);
goto err_srq; goto err_usr_kern_srq;
} }
mlx5_ib_dbg(dev, "create SRQ with srqn 0x%x\n", srq->msrq.srqn); mlx5_ib_dbg(dev, "create SRQ with srqn 0x%x\n", srq->msrq.srqn);
...@@ -316,6 +316,8 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, ...@@ -316,6 +316,8 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
err_core: err_core:
mlx5_core_destroy_srq(&dev->mdev, &srq->msrq); mlx5_core_destroy_srq(&dev->mdev, &srq->msrq);
err_usr_kern_srq:
if (pd->uobject) if (pd->uobject)
destroy_srq_user(pd, srq); destroy_srq_user(pd, srq);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment