public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RDMA/efa: Fix possible deadlock
@ 2026-03-14  4:57 Ethan Tidmore
  2026-03-14  5:38 ` Ethan Tidmore
  2026-03-16 20:20 ` Leon Romanovsky
  0 siblings, 2 replies; 3+ messages in thread
From: Ethan Tidmore @ 2026-03-14  4:57 UTC (permalink / raw)
  To: Michael Margolin, Jason Gunthorpe, linux-rdma
  Cc: Leon Romanovsky, Gal Pressman, Yossi Leybovich, Daniel Kranzdorf,
	Yonatan Nachum, linux-kernel, Ethan Tidmore

In the error path for efa_com_alloc_comp_ctx() the lock assigned to
&aq->avail_cmds is not released.

Add release for &aq->avail_cmds in efa_com_alloc_comp_ctx() error path.

Fixes: ef3b06742c8a2 ("RDMA/efa: Fix use of completion ctx after free")
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
 drivers/infiniband/hw/efa/efa_com.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/hw/efa/efa_com.c b/drivers/infiniband/hw/efa/efa_com.c
index 56caba612139..e97b5f0d7003 100644
--- a/drivers/infiniband/hw/efa/efa_com.c
+++ b/drivers/infiniband/hw/efa/efa_com.c
@@ -629,6 +629,7 @@ int efa_com_cmd_exec(struct efa_com_admin_queue *aq,
 	comp_ctx = efa_com_alloc_comp_ctx(aq);
 	if (!comp_ctx) {
 		clear_bit(EFA_AQ_STATE_RUNNING_BIT, &aq->state);
+		up(&aq->avail_cmds);
 		return -EINVAL;
 	}
 
-- 
2.53.0


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

* Re: [PATCH] RDMA/efa: Fix possible deadlock
  2026-03-14  4:57 [PATCH] RDMA/efa: Fix possible deadlock Ethan Tidmore
@ 2026-03-14  5:38 ` Ethan Tidmore
  2026-03-16 20:20 ` Leon Romanovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Ethan Tidmore @ 2026-03-14  5:38 UTC (permalink / raw)
  To: Ethan Tidmore, Michael Margolin, Jason Gunthorpe, linux-rdma
  Cc: Leon Romanovsky, Gal Pressman, Yossi Leybovich, Daniel Kranzdorf,
	Yonatan Nachum, linux-kernel

On Fri Mar 13, 2026 at 11:57 PM CDT, Ethan Tidmore wrote:
> In the error path for efa_com_alloc_comp_ctx() the lock assigned to
> &aq->avail_cmds is not released.
>
> Add release for &aq->avail_cmds in efa_com_alloc_comp_ctx() error path.

Detected by Smatch:
drivers/infiniband/hw/efa/efa_com.c:662 efa_com_cmd_exec() warn:
inconsistent returns '&aq->avail_cmds'

>
> Fixes: ef3b06742c8a2 ("RDMA/efa: Fix use of completion ctx after free")
> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
> ---

Forgot to add the Smatch warning, if this version is good please add
this to the commit message.

Thanks,

ET

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

* Re: [PATCH] RDMA/efa: Fix possible deadlock
  2026-03-14  4:57 [PATCH] RDMA/efa: Fix possible deadlock Ethan Tidmore
  2026-03-14  5:38 ` Ethan Tidmore
@ 2026-03-16 20:20 ` Leon Romanovsky
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2026-03-16 20:20 UTC (permalink / raw)
  To: Michael Margolin, Jason Gunthorpe, linux-rdma, Ethan Tidmore
  Cc: Gal Pressman, Yossi Leybovich, Daniel Kranzdorf, Yonatan Nachum,
	linux-kernel


On Fri, 13 Mar 2026 23:57:30 -0500, Ethan Tidmore wrote:
> In the error path for efa_com_alloc_comp_ctx() the lock assigned to
> &aq->avail_cmds is not released.
> 
> Add release for &aq->avail_cmds in efa_com_alloc_comp_ctx() error path.

Applied, thanks!

[1/1] RDMA/efa: Fix possible deadlock
      https://git.kernel.org/rdma/rdma/c/5c241838c6bba6

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


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

end of thread, other threads:[~2026-03-16 20:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-14  4:57 [PATCH] RDMA/efa: Fix possible deadlock Ethan Tidmore
2026-03-14  5:38 ` Ethan Tidmore
2026-03-16 20:20 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox