Skip to content

Commit 0f2055d

Browse files
Ethan Tidmorerleon
authored andcommitted
RDMA/efa: Fix possible deadlock
In the error path for efa_com_alloc_comp_ctx() the semaphore assigned to &aq->avail_cmds is not released. Detected by Smatch: drivers/infiniband/hw/efa/efa_com.c:662 efa_com_cmd_exec() warn: inconsistent returns '&aq->avail_cmds' Add release for &aq->avail_cmds in efa_com_alloc_comp_ctx() error path. Fixes: ef3b067 ("RDMA/efa: Fix use of completion ctx after free") Signed-off-by: Ethan Tidmore <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent f28599f commit 0f2055d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/infiniband/hw/efa/efa_com.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ int efa_com_cmd_exec(struct efa_com_admin_queue *aq,
629629
comp_ctx = efa_com_alloc_comp_ctx(aq);
630630
if (!comp_ctx) {
631631
clear_bit(EFA_AQ_STATE_RUNNING_BIT, &aq->state);
632+
up(&aq->avail_cmds);
632633
return -EINVAL;
633634
}
634635

0 commit comments

Comments
 (0)