* [PATCH] RDMA/mlx5: Return ENOMEM when allocating a MEMIC operation fails
@ 2026-11-12 2:31 Zhu Jun
2026-11-12 2:37 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Zhu Jun @ 2026-11-12 2:31 UTC (permalink / raw)
To: leon; +Cc: jgg, linux-rdma, linux-kernel, Zhu Jun
When a MEMIC operation is not already mapped, map_existing_op() leaves
err set to -ENOENT. If allocating the new operation entry then fails, the
handler returns that stale lookup error instead of -ENOMEM.
Set err to -ENOMEM before allocating the operation entry.
OpenAI Codex assisted with analysis and patch preparation.
Fixes: cea85fa5dbc2 ("RDMA/mlx5: Add support in MEMIC operations")
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
drivers/infiniband/hw/mlx5/dm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/hw/mlx5/dm.c b/drivers/infiniband/hw/mlx5/dm.c
index 7a6fe4fea3e2..61727118d1b4 100644
--- a/drivers/infiniband/hw/mlx5/dm.c
+++ b/drivers/infiniband/hw/mlx5/dm.c
@@ -228,6 +228,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DM_MAP_OP_ADDR)(
if (!err || err != -ENOENT)
goto err_unlock;
+ err = -ENOMEM;
op_entry = kzalloc_obj(*op_entry);
if (!op_entry)
goto err_unlock;
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-12 2:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 2:31 [PATCH] RDMA/mlx5: Return ENOMEM when allocating a MEMIC operation fails Zhu Jun
2026-11-12 2:37 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox