RDMA/efa: Fix possible deadlock
Subsystems (2)
PATCH 1/1 RDMA/efa: Fix possible deadlock
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.
--- drivers/infiniband/hw/efa/efa_com.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/hw/efa/efa_com.c +1 -0
@@ -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 ; }
Signature · 1 line
2.53.0
Quoted 4 lines · Ethan Tidmore
In the error path for
efa_com_alloc_comp_ctx()the lock assigned to&aq->avail_cmdsis not released.Add release for
&aq->avail_cmdsinefa_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'
Quoted 4 lines
Fixes ef3b06742c8a2 ("RDMA/efa: Fix use of completion ctx after free")Signed-off-by Ethan Tidmore <[email protected]>---
Forgot to add the Smatch warning, if this version is good please add this to the commit message.
Thanks,
ET
Leon Romanovsky
AppliedQuoted 4 lines · Ethan Tidmore
In the error path for
efa_com_alloc_comp_ctx()the lock assigned to&aq->avail_cmdsis not released.Add release for
&aq->avail_cmdsinefa_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,
Signature · 1 line
Leon Romanovsky <[email protected]>