IB/mlx5: Fix a potential memory leak in setup_qp()
Subsystems (2)
PATCH 1/1 IB/mlx5: Fix a potential memory leak in setup_qp()
create_gsi_ud_qp() creates a QP but the QP is not
released if modify_to_rts() fails. Free the QP by
calling ib_destroy_qp().
Fixes ebab41cff4db ("IB/mlx5: Create multiple transmission GSI QPs")
Signed-off-by Wanhui Fu <[email protected]>
--- drivers/infiniband/hw/mlx5/gsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/gsi.c +1 -1
@@ -316,7 +316,7 @@ static void setup_qp(struct mlx5_ib_gsi_qp *gsi, u16 qp_index)return ; err_destroy_qp: -WARN_ON_ONCE (qp); +WARN_ON_ONCE (ib_destroy_qp (qp)); } int mlx5_ib_gsi_modify_qp(struct ib_qp *qp, struct ib_qp_attr *attr,
Signature · 1 line
2.25.1
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 6 lines
create_gsi_ud_qp()creates a QP but the QP is not
released ifmodify_to_rts()fails. Free the QP by
callingib_destroy_qp().Fixes ebab41cff4db ("IB/mlx5: Create multiple transmission GSI QPs")Signed-off-by Wanhui Fu <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 27 lines · Wanhui Fu
External email: Use caution opening links or attachments
create_gsi_ud_qp()creates a QP but the QP is not
released ifmodify_to_rts()fails. Free the QP by
callingib_destroy_qp().Fixes ebab41cff4db ("IB/mlx5: Create multiple transmission GSI QPs")Signed-off-by Wanhui Fu <[email protected]>--- drivers/infiniband/hw/mlx5/gsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/infiniband/hw/mlx5/gsi.c +1
-2@@ -316,7 +316,7 @@ static void setup_qp(struct mlx5_ib_gsi_qp *gsi, u16 qp_index)return ; err_destroy_qp: -WARN_ON_ONCE (qp); +WARN_ON_ONCE (ib_destroy_qp (qp)); } int mlx5_ib_gsi_modify_qp(struct ib_qp *qp, struct ib_qp_attr *attr, --
Quoted 1 line
2.25.1
Reviewed-by Edward Srouji <[email protected]>
Leon Romanovsky
AppliedQuoted 3 lines · Wanhui Fu
create_gsi_ud_qp()creates a QP but the QP is not
released ifmodify_to_rts()fails. Free the QP by
callingib_destroy_qp().
Applied, thanks!
[1/1] IB/mlx5: Fix a potential memory leak in setup_qp()
https://git.kernel.org/rdma/rdma/c/274daf227ed929
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>