All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/mlx5: Fix a potential memory leak in setup_qp()
@ 2026-11-21  9:59 Wanhui Fu
  2026-11-21 10:06 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Wanhui Fu @ 2026-11-21  9:59 UTC (permalink / raw)
  To: leon, jgg, haggaie, dledford; +Cc: linux-rdma, Wanhui Fu

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 <fuwh1120@163.com>
---
 drivers/infiniband/hw/mlx5/gsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/gsi.c b/drivers/infiniband/hw/mlx5/gsi.c
index b2e2a219639d..535a9f45fb33 100644
--- a/drivers/infiniband/hw/mlx5/gsi.c
+++ b/drivers/infiniband/hw/mlx5/gsi.c
@@ -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,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-21 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21  9:59 [PATCH] IB/mlx5: Fix a potential memory leak in setup_qp() Wanhui Fu
2026-11-21 10:06 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.