* [PATCH 5/5] RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event()
@ 2026-09-16 18:39 Wentao Liang
2026-09-23 8:08 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-09-16 18:39 UTC (permalink / raw)
To: jgg
Cc: leon, linux-kernel, linux-rdma, markzhang, phaddad, Wentao Liang, stable
Since commit 312b8f79eb05 ("RDMA/mlx: Calling qp event handler in
workqueue context") rsc_event_notifier() expects the event handler to
drop the resource reference taken by mlx5_get_rsc(). mlx5_ib_wq_event()
was missed by that conversion, so every RQ event leaks one reference,
which keeps destroy_resource_common() waiting on the completion.
Put the resource reference on all exits of the handler.
Fixes: 312b8f79eb05 ("RDMA/mlx: Calling qp event handler in workqueue context")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/infiniband/hw/mlx5/qp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 8fd05532c09c..e8d03cc60a00 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -5200,11 +5200,14 @@ static void mlx5_ib_wq_event(struct mlx5_core_qp *core_qp, int type)
break;
default:
mlx5_ib_warn(dev, "Unexpected event type %d on WQ %06x\n", type, core_qp->qpn);
- return;
+ goto out;
}
rwq->ibwq.event_handler(&event, rwq->ibwq.wq_context);
}
+
+out:
+ mlx5_core_res_put(&core_qp->common);
}
static int set_delay_drop(struct mlx5_ib_dev *dev)
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 5/5] RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event()
2026-09-16 18:39 [PATCH 5/5] RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event() Wentao Liang
@ 2026-09-23 8:08 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2026-09-23 8:08 UTC (permalink / raw)
To: jgg, Wentao Liang; +Cc: linux-kernel, linux-rdma, markzhang, phaddad, stable
On Wed, 16 Sep 2026 18:39:21 +0000, Wentao Liang wrote:
> Since commit 312b8f79eb05 ("RDMA/mlx: Calling qp event handler in
> workqueue context") rsc_event_notifier() expects the event handler to
> drop the resource reference taken by mlx5_get_rsc(). mlx5_ib_wq_event()
> was missed by that conversion, so every RQ event leaks one reference,
> which keeps destroy_resource_common() waiting on the completion.
>
> Put the resource reference on all exits of the handler.
>
> [...]
Applied, thanks!
[5/5] RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event()
https://git.kernel.org/rdma/rdma/c/65f3eab4319444
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-23 8:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 18:39 [PATCH 5/5] RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event() Wentao Liang
2026-09-23 8:08 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®